Integration improvements 0020310 and 0020431.

This commit is contained in:
skl 2009-08-27 07:26:22 +00:00
parent 874fdebf62
commit 3add66f219
40 changed files with 3784 additions and 231 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -11,6 +11,7 @@
<li>\ref number_of_segments_anchor "Number of segments"</li> <li>\ref number_of_segments_anchor "Number of segments"</li>
<li>\ref start_and_end_length_anchor "Start and end length"</li> <li>\ref start_and_end_length_anchor "Start and end length"</li>
<li>\ref automatic_length_anchor "Automatic Length"</li> <li>\ref automatic_length_anchor "Automatic Length"</li>
<li>\ref fixed_points_1d_anchor "Fixed points 1D"</li>
</ul> </ul>
<br> <br>
@ -193,4 +194,36 @@ minimum and maximum value of this parameter.
\image html image147.gif "Example of a very rough mesh. Automatic Length works for 0." \image html image147.gif "Example of a very rough mesh. Automatic Length works for 0."
\image html image148.gif "Example of a very fine mesh. Automatic Length works for 1." \image html image148.gif "Example of a very fine mesh. Automatic Length works for 1."
<br>
\anchor fixed_points_1d_anchor
<h2>Fixed points 1D hypothesis</h2>
<b>Fixed points 1D</b> hypothesis allows to split edges into segments
using set of fixed points given by normalized parameters on edge and
set of numbers of segments for splitting each sub-segment between
fixed points. Optionally it is possible to set flag
<b>Same Nb. Segments for all intervals</b> and
only one value for mentioned number of segments.
The direction of the splitting is defined by the orientation of the
underlying geometrical edge. <b>"Reverse Edges"</b> list box allows to
specify the edges for which the splitting should be made in the
direction opposing to their orientation. This list box is enabled only
if the geometry object is selected for the meshing. In this case the
user can select edges to be reversed either directly picking them in
the 3D viewer or by selecting the edges or groups of edges in the
Object browser.
Using of this hypothesis for quadrangle face where main mesh is
created using <b>Quadrangle(Mapping)</b> and <b>NumberOfSegments</b>
hypothesises. Creation hypothesis <b>FixedPoint_1D</b> for submesh on
one edge:
\image html hypo_fixedpnt_dlg.png
Resulting 2D mesh:
\image html mesh_fixedpnt.png
*/ */

View File

@ -25,6 +25,8 @@ shape of a mesh.</li>
are split into triangular elements.</li> are split into triangular elements.</li>
<li>Quadrangle meshing algorithm (Mapping) - Faces are split into <li>Quadrangle meshing algorithm (Mapping) - Faces are split into
quadrangular elements.</li> quadrangular elements.</li>
<li>Radial quadrangle 1D2D algorithm - Faces (circles or part of circles)
are split into triangular and quadrangle elements.</li>
</ul> </ul>
\image html image123.gif "Example of a triangular 2D mesh" \image html image123.gif "Example of a triangular 2D mesh"
@ -54,6 +56,8 @@ There is also a number of more specific algorithms:
<li>\subpage radial_prism_algo_page "for meshing geometrical objects with cavities"</li> <li>\subpage radial_prism_algo_page "for meshing geometrical objects with cavities"</li>
<li>\subpage segments_around_vertex_algo_page "for defining the local size of elements around a certain node"</li> <li>\subpage segments_around_vertex_algo_page "for defining the local size of elements around a certain node"</li>
<li>\subpage prism_3d_algo_page "for meshing prismatic shapes"</li> <li>\subpage prism_3d_algo_page "for meshing prismatic shapes"</li>
<li>\subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d
faces (circles and part of circles)"</li>
</ul> </ul>
\ref constructing_meshes_page "Constructing meshes" page describes in \ref constructing_meshes_page "Constructing meshes" page describes in

View File

@ -0,0 +1,28 @@
/*!
\page radial_quadrangle_1D2D_algo_page Radial Quadrangle 1D2D
\n This algorithm applies to the meshing of a 2D shapes.
Required conditions: Face must be a full circle or part of circle
(i.e. number of edges <= 3 and one of them must be a circle curve).
The resulting mesh consists of triangles (near center point) and
quadrangles.
This algorithm also requires the information concerning the number and
distribution of mesh layers alond a radius of circle. Distribution of
layers can be set with any of 1D Hypotheses.
Creation hypothesis:
\image html hypo_radquad_dlg.png
Resulting 3D mesh for the cylinder with <b>RadialQuadrangle_1D2D</b>
hypothesis for top and bottom faces:
\image html mesh_radquad_01.png
Resulting 2D mesh for the part of circle:
\image html mesh_radquad_02.png
*/

View File

@ -385,6 +385,54 @@ module StdMeshers
}; };
/*!
* StdMeshers_FixedPoints1D: interface of "Fixed points 1D" hypothesis
*/
interface StdMeshers_FixedPoints1D : SMESH::SMESH_Hypothesis
{
/*!
* Sets some points on edge using parameter on curve from 0 to 1
* (additionally it is neecessary to check orientation of edges and
* create list of reversed edges if it is needed) and sets numbers
* of segments between given points (default values are equals 1)
*/
void SetPoints(in SMESH::double_array listParams)
raises (SALOME::SALOME_Exception);
void SetNbSegments(in SMESH::long_array listNbSeg)
raises (SALOME::SALOME_Exception);
/*!
* Returns list of point's parameters
*/
SMESH::double_array GetPoints();
/*!
* Returns list of numbers of segments
*/
SMESH::long_array GetNbSegments();
/*!
* Set list of edges to reverse
*/
void SetReversedEdges( in SMESH::long_array list );
/*!
* Returns list of edges to reverse
*/
SMESH::long_array GetReversedEdges();
/*!
* Set entry of the main object
*/
void SetObjectEntry( in string entry );
/*!
* Get the entry of the main object
*/
string GetObjectEntry();
};
/*! /*!
* StdMeshers_MaxElementVolume: interface of "Max. Hexahedron or Tetrahedron Volume" hypothesis * StdMeshers_MaxElementVolume: interface of "Max. Hexahedron or Tetrahedron Volume" hypothesis
*/ */
@ -498,6 +546,26 @@ module StdMeshers
}; };
/*!
* StdMeshers_NumberOfLayers2D: interface of "Nb. Layers" hypothesis.
* This hypothesis is used by "Radial quadrangle" algorithm.
* It specifies number of segments between the internal
* and the external surfaces.
*/
interface StdMeshers_NumberOfLayers2D : StdMeshers_NumberOfLayers
{
};
/*!
* StdMeshers_LayerDistribution2D: interface of "Distribution of Layers" hypothesis.
* This hypothesis is used by "Radial quadrangle" algorithm.
* It specifies 1D hypothesis defining distribution of segments between the internal
* and the external surfaces.
*/
interface StdMeshers_LayerDistribution2D : StdMeshers_LayerDistribution
{
};
/*! /*!
* interface of "ProjectionSource1D" hypothesis. * interface of "ProjectionSource1D" hypothesis.
* This hypothesis specifies a meshed edge to take a mesh pattern from * This hypothesis specifies a meshed edge to take a mesh pattern from
@ -800,6 +868,13 @@ module StdMeshers
{ {
}; };
/*!
* StdMeshers_RadialQuadrangle_1D2D: interface of "Radial quadrangle" algorithm
*/
interface StdMeshers_RadialQuadrangle_1D2D : SMESH::SMESH_2D_Algo
{
};
}; };
#endif #endif

View File

@ -54,6 +54,11 @@
icon-id="mesh_hypo_length.png" icon-id="mesh_hypo_length.png"
dim="1"/> dim="1"/>
<hypothesis type="FixedPoints1D"
label-id="Fixed points 1D"
icon-id="mesh_hypo_length.png"
dim="1"/>
<hypothesis type="StartEndLength" <hypothesis type="StartEndLength"
label-id="Start and End Length" label-id="Start and End Length"
icon-id="mesh_hypo_length.png" icon-id="mesh_hypo_length.png"
@ -145,6 +150,16 @@
icon-id="mesh_hypo_length.png" icon-id="mesh_hypo_length.png"
dim="3"/> dim="3"/>
<hypothesis type="NumberOfLayers2D"
label-id="Number of Layers"
icon-id="mesh_hypo_length.png"
dim="2"/>
<hypothesis type="LayerDistribution2D"
label-id="Distribution of Layers"
icon-id="mesh_hypo_length.png"
dim="2"/>
<hypothesis type="QuadrangleParams" <hypothesis type="QuadrangleParams"
label-id="Quadrangle Parameters" label-id="Quadrangle Parameters"
icon-id="mesh_hypo_length.png" icon-id="mesh_hypo_length.png"
@ -164,7 +179,7 @@
<algorithm type="Regular_1D" <algorithm type="Regular_1D"
label-id="Wire discretisation" label-id="Wire discretisation"
icon-id="mesh_algo_regular.png" icon-id="mesh_algo_regular.png"
hypos="LocalLength,MaxLength,Arithmetic1D,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength" hypos="LocalLength,MaxLength,Arithmetic1D,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength,FixedPoints1D"
opt-hypos="Propagation,QuadraticMesh" opt-hypos="Propagation,QuadraticMesh"
input="VERTEX" input="VERTEX"
output="EDGE" output="EDGE"
@ -251,6 +266,14 @@
output="QUAD,TRIA" output="QUAD,TRIA"
dim="2"/> dim="2"/>
<algorithm type="RadialQuadrangle_1D2D"
label-id="Radial quadrangle 1D2D"
icon-id="mesh_algo_quad.png"
hypos="NumberOfLayers2D, LayerDistribution2D"
input="EDGE"
output="QUAD,TRIA"
dim="2"/>
</algorithms> </algorithms>
</meshers-group> </meshers-group>

View File

@ -505,6 +505,8 @@ QString SMESHGUI_GenericHypothesisCreator::helpPage() const
aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor"; aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor";
else if ( aHypType == "Arithmetic1D") else if ( aHypType == "Arithmetic1D")
aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor"; aHelpFileName = "a1d_meshing_hypo_page.html#arithmetic_1d_anchor";
else if ( aHypType == "FixedPointsc1D")
aHelpFileName = "a1d_meshing_hypo_page.html#fixed_points_1d_anchor";
else if ( aHypType == "MaxElementArea") else if ( aHypType == "MaxElementArea")
aHelpFileName = "a2d_meshing_hypo_page.html#max_element_area_anchor"; aHelpFileName = "a2d_meshing_hypo_page.html#max_element_area_anchor";
else if ( aHypType == "MaxElementVolume") else if ( aHypType == "MaxElementVolume")

View File

@ -3741,6 +3741,45 @@ class Mesh_Segment(Mesh_Algorithm):
return True return True
return False return False
## Defines "FixedPoints1D" hypothesis to cut an edge using parameter
# on curve from 0 to 1 (additionally it is neecessary to check
# orientation of edges and create list of reversed edges if it is
# needed) and sets numbers of segments between given points (default
# values are equals 1
# @param points defines the list of parameters on curve
# @param nbSegs defines the list of numbers of segments
# @param reversedEdges is a list of edges to mesh using reversed orientation
# @param UseExisting if ==true - searches for an existing hypothesis created with
# the same parameters, else (default) - creates a new one
# @return an instance of StdMeshers_Arithmetic1D hypothesis
# @ingroup l3_hypos_1dhyps
def FixedPoints1D(self, points, nbSegs=[1], reversedEdges=[], UseExisting=0):
if not isinstance(reversedEdges,list): #old version script, before adding reversedEdges
reversedEdges, UseExisting = [], reversedEdges
entry = self.MainShapeEntry()
hyp = self.Hypothesis("FixedPoints1D", [points, nbSegs, reversedEdges, entry],
UseExisting=UseExisting,
CompareMethod=self.CompareArithmetic1D)
hyp.SetPoints(points)
hyp.SetNbSegments(nbSegs)
hyp.SetReversedEdges(reversedEdges)
hyp.SetObjectEntry(entry)
return hyp
## Private method
## Check if the given "FixedPoints1D" hypothesis has the same parameters
## as the given arguments
def CompareFixedPoints1D(self, hyp, args):
if hyp.GetPoints() == args[0]:
if hyp.GetNbSegments() == args[1]:
if hyp.GetReversedEdges() == args[2]:
if not args[2] or hyp.GetObjectEntry() == args[3]:
return True
return False
## Defines "StartEndLength" hypothesis to cut an edge in several segments with increasing geometric length ## Defines "StartEndLength" hypothesis to cut an edge in several segments with increasing geometric length
# @param start defines the length of the first segment # @param start defines the length of the first segment
# @param end defines the length of the last segment # @param end defines the length of the last segment
@ -4804,6 +4843,104 @@ class Mesh_RadialPrism3D(Mesh_Algorithm):
hyp.SetFineness( fineness ) hyp.SetFineness( fineness )
return hyp return hyp
# Public class: Mesh_RadialQuadrangle1D2D
# -------------------------------
## Defines a Radial Quadrangle 1D2D algorithm
# @ingroup l2_algos_radialq
#
class Mesh_RadialQuadrangle1D2D(Mesh_Algorithm):
## Private constructor.
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, "RadialQuadrangle_1D2D")
self.distribHyp = self.Hypothesis("LayerDistribution2D", UseExisting=0)
self.nbLayers = None
## Return 2D hypothesis holding the 1D one
def Get2DHypothesis(self):
return self.distribHyp
## Private method creating a 1D hypothesis and storing it in the LayerDistribution
# hypothesis. Returns the created hypothesis
def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"):
#print "OwnHypothesis",hypType
if not self.nbLayers is None:
self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers )
self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp )
study = self.mesh.smeshpyD.GetCurrentStudy() # prevents publishing own 1D hypothesis
hyp = self.mesh.smeshpyD.CreateHypothesis(hypType, so)
self.mesh.smeshpyD.SetCurrentStudy( study ) # enables publishing
self.distribHyp.SetLayerDistribution( hyp )
return hyp
## Defines "NumberOfLayers2D" hypothesis, specifying the number of layers
# @param n number of layers
# @param UseExisting if ==true - searches for the existing hypothesis created with
# the same parameters, else (default) - creates a new one
def NumberOfLayers2D(self, n, UseExisting=0):
self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp )
self.nbLayers = self.Hypothesis("NumberOfLayers2D", [n], UseExisting=UseExisting,
CompareMethod=self.CompareNumberOfLayers)
self.nbLayers.SetNumberOfLayers( n )
return self.nbLayers
## Checks if the given "NumberOfLayers" hypothesis has the same parameters as the given arguments
def CompareNumberOfLayers(self, hyp, args):
return IsEqual(hyp.GetNumberOfLayers(), args[0])
## Defines "LocalLength" hypothesis, specifying the segment length
# @param l the length of segments
# @param p the precision of rounding
def LocalLength(self, l, p=1e-07):
hyp = self.OwnHypothesis("LocalLength", [l,p])
hyp.SetLength(l)
hyp.SetPrecision(p)
return hyp
## Defines "NumberOfSegments" hypothesis, specifying the number of layers
# @param n the number of layers
# @param s the scale factor (optional)
def NumberOfSegments(self, n, s=[]):
if s == []:
hyp = self.OwnHypothesis("NumberOfSegments", [n])
else:
hyp = self.OwnHypothesis("NumberOfSegments", [n,s])
hyp.SetDistrType( 1 )
hyp.SetScaleFactor(s)
hyp.SetNumberOfSegments(n)
return hyp
## Defines "Arithmetic1D" hypothesis, specifying the distribution of segments
# with a length that changes in arithmetic progression
# @param start the length of the first segment
# @param end the length of the last segment
def Arithmetic1D(self, start, end ):
hyp = self.OwnHypothesis("Arithmetic1D", [start, end])
hyp.SetLength(start, 1)
hyp.SetLength(end , 0)
return hyp
## Defines "StartEndLength" hypothesis, specifying distribution of segments
# as geometric length increasing
# @param start for the length of the first segment
# @param end for the length of the last segment
def StartEndLength(self, start, end):
hyp = self.OwnHypothesis("StartEndLength", [start, end])
hyp.SetLength(start, 1)
hyp.SetLength(end , 0)
return hyp
## Defines "AutomaticLength" hypothesis, specifying the number of segments
# @param fineness defines the quality of the mesh within the range [0-1]
def AutomaticLength(self, fineness=0):
hyp = self.OwnHypothesis("AutomaticLength")
hyp.SetFineness( fineness )
return hyp
# Private class: Mesh_UseExisting # Private class: Mesh_UseExisting
# ------------------------------- # -------------------------------
class Mesh_UseExisting(Mesh_Algorithm): class Mesh_UseExisting(Mesh_Algorithm):

View File

@ -32,6 +32,7 @@ salomeinclude_HEADERS = \
StdMeshers_LocalLength.hxx \ StdMeshers_LocalLength.hxx \
StdMeshers_StartEndLength.hxx \ StdMeshers_StartEndLength.hxx \
StdMeshers_Arithmetic1D.hxx \ StdMeshers_Arithmetic1D.hxx \
StdMeshers_FixedPoints1D.hxx \
StdMeshers_NumberOfSegments.hxx \ StdMeshers_NumberOfSegments.hxx \
StdMeshers_Deflection1D.hxx \ StdMeshers_Deflection1D.hxx \
StdMeshers_Propagation.hxx \ StdMeshers_Propagation.hxx \
@ -49,6 +50,7 @@ salomeinclude_HEADERS = \
StdMeshers_QuadranglePreference.hxx \ StdMeshers_QuadranglePreference.hxx \
StdMeshers_QuadraticMesh.hxx \ StdMeshers_QuadraticMesh.hxx \
StdMeshers_NumberOfLayers.hxx \ StdMeshers_NumberOfLayers.hxx \
StdMeshers_NumberOfLayers2D.hxx \
StdMeshers_Prism_3D.hxx \ StdMeshers_Prism_3D.hxx \
StdMeshers_ProjectionSource1D.hxx \ StdMeshers_ProjectionSource1D.hxx \
StdMeshers_ProjectionSource2D.hxx \ StdMeshers_ProjectionSource2D.hxx \
@ -59,6 +61,7 @@ salomeinclude_HEADERS = \
StdMeshers_RadialPrism_3D.hxx \ StdMeshers_RadialPrism_3D.hxx \
StdMeshers_ProjectionUtils.hxx \ StdMeshers_ProjectionUtils.hxx \
StdMeshers_LayerDistribution.hxx \ StdMeshers_LayerDistribution.hxx \
StdMeshers_LayerDistribution2D.hxx \
StdMeshers_SegmentAroundVertex_0D.hxx \ StdMeshers_SegmentAroundVertex_0D.hxx \
StdMeshers_SegmentLengthAroundVertex.hxx \ StdMeshers_SegmentLengthAroundVertex.hxx \
StdMeshers_FaceSide.hxx \ StdMeshers_FaceSide.hxx \
@ -69,7 +72,8 @@ salomeinclude_HEADERS = \
StdMeshers_TrianglePreference.hxx \ StdMeshers_TrianglePreference.hxx \
StdMeshers_CompositeHexa_3D.hxx \ StdMeshers_CompositeHexa_3D.hxx \
StdMeshers_MaxLength.hxx \ StdMeshers_MaxLength.hxx \
StdMeshers_QuadrangleParams.hxx StdMeshers_QuadrangleParams.hxx \
StdMeshers_RadialQuadrangle_1D2D.hxx
# Libraries targets # Libraries targets
@ -79,6 +83,7 @@ dist_libStdMeshers_la_SOURCES = \
StdMeshers_LocalLength.cxx \ StdMeshers_LocalLength.cxx \
StdMeshers_StartEndLength.cxx \ StdMeshers_StartEndLength.cxx \
StdMeshers_Arithmetic1D.cxx \ StdMeshers_Arithmetic1D.cxx \
StdMeshers_FixedPoints1D.cxx \
StdMeshers_NumberOfSegments.cxx \ StdMeshers_NumberOfSegments.cxx \
StdMeshers_Deflection1D.cxx \ StdMeshers_Deflection1D.cxx \
StdMeshers_Propagation.cxx \ StdMeshers_Propagation.cxx \
@ -96,6 +101,7 @@ dist_libStdMeshers_la_SOURCES = \
StdMeshers_QuadranglePreference.cxx \ StdMeshers_QuadranglePreference.cxx \
StdMeshers_QuadraticMesh.cxx \ StdMeshers_QuadraticMesh.cxx \
StdMeshers_NumberOfLayers.cxx \ StdMeshers_NumberOfLayers.cxx \
StdMeshers_NumberOfLayers2D.cxx \
StdMeshers_Prism_3D.cxx \ StdMeshers_Prism_3D.cxx \
StdMeshers_ProjectionSource1D.cxx \ StdMeshers_ProjectionSource1D.cxx \
StdMeshers_ProjectionSource2D.cxx \ StdMeshers_ProjectionSource2D.cxx \
@ -106,6 +112,7 @@ dist_libStdMeshers_la_SOURCES = \
StdMeshers_RadialPrism_3D.cxx \ StdMeshers_RadialPrism_3D.cxx \
StdMeshers_ProjectionUtils.cxx \ StdMeshers_ProjectionUtils.cxx \
StdMeshers_LayerDistribution.cxx \ StdMeshers_LayerDistribution.cxx \
StdMeshers_LayerDistribution2D.cxx \
StdMeshers_SegmentAroundVertex_0D.cxx \ StdMeshers_SegmentAroundVertex_0D.cxx \
StdMeshers_SegmentLengthAroundVertex.cxx \ StdMeshers_SegmentLengthAroundVertex.cxx \
StdMeshers_FaceSide.cxx \ StdMeshers_FaceSide.cxx \
@ -115,7 +122,8 @@ dist_libStdMeshers_la_SOURCES = \
StdMeshers_TrianglePreference.cxx \ StdMeshers_TrianglePreference.cxx \
StdMeshers_CompositeHexa_3D.cxx \ StdMeshers_CompositeHexa_3D.cxx \
StdMeshers_MaxLength.cxx \ StdMeshers_MaxLength.cxx \
StdMeshers_QuadrangleParams.cxx StdMeshers_QuadrangleParams.cxx \
StdMeshers_RadialQuadrangle_1D2D.cxx
# additionnal information to compil and link file # additionnal information to compil and link file

View File

@ -0,0 +1,243 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FixedPoints1D.cxx
// Author : Damien COQUERET, OCC
// Module : SMESH
//
#include "StdMeshers_FixedPoints1D.hxx"
#include "SMESH_Algo.hxx"
#include "SMESH_Mesh.hxx"
//#include <BRep_Tool.hxx>
//#include <GCPnts_AbscissaPoint.hxx>
//#include <GeomAdaptor_Curve.hxx>
//#include <Geom_Curve.hxx>
//#include <TopExp.hxx>
//#include <TopLoc_Location.hxx>
//#include <TopTools_IndexedMapOfShape.hxx>
//#include <TopoDS.hxx>
//#include <TopoDS_Edge.hxx>
using namespace std;
//=============================================================================
/*!
*
*/
//=============================================================================
StdMeshers_FixedPoints1D::StdMeshers_FixedPoints1D(int hypId, int studyId,
SMESH_Gen * gen)
:SMESH_Hypothesis(hypId, studyId, gen)
{
_name = "FixedPoints1D";
_param_algo_dim = 1;
_nbsegs.reserve( 1 );
_nbsegs.push_back( 1 );
}
//=============================================================================
/*!
*
*/
//=============================================================================
StdMeshers_FixedPoints1D::~StdMeshers_FixedPoints1D()
{
}
//=============================================================================
/*!
*
*/
//=============================================================================
void StdMeshers_FixedPoints1D::SetPoints(std::vector<double>& listParams)
throw(SALOME_Exception)
{
_params = listParams;
NotifySubMeshesHypothesisModification();
}
//=============================================================================
/*!
*
*/
//=============================================================================
void StdMeshers_FixedPoints1D::SetNbSegments(std::vector<int>& listNbSeg)
throw(SALOME_Exception)
{
_nbsegs = listNbSeg;
NotifySubMeshesHypothesisModification();
}
//=============================================================================
/*!
*
*/
//=============================================================================
void StdMeshers_FixedPoints1D::SetReversedEdges( std::vector<int>& ids )
{
if ( ids != _edgeIDs ) {
_edgeIDs = ids;
NotifySubMeshesHypothesisModification();
}
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & StdMeshers_FixedPoints1D::SaveTo(ostream & save)
{
int listSize = _params.size();
save << listSize;
if ( listSize > 0 ) {
for ( int i = 0; i < listSize; i++) save << " " << _params[i];
}
listSize = _nbsegs.size();
save << listSize;
if ( listSize > 0 ) {
for ( int i = 0; i < listSize; i++) save << " " << _nbsegs[i];
}
listSize = _edgeIDs.size();
save << listSize;
if ( listSize > 0 ) {
for ( int i = 0; i < listSize; i++)
save << " " << _edgeIDs[i];
}
save << " " << _objEntry;
return save;
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load)
{
bool isOK = true;
int intVal;
double dblVal;
isOK = (load >> intVal);
if (isOK && intVal > 0) {
_params.reserve( intVal );
for (int i = 0; i < _params.capacity() && isOK; i++) {
isOK = (load >> dblVal);
if ( isOK ) _params.push_back( dblVal );
}
}
isOK = (load >> intVal);
if (isOK && intVal > 0) {
_nbsegs.reserve( intVal );
for (int i = 0; i < _nbsegs.capacity() && isOK; i++) {
isOK = (load >> intVal);
if ( isOK ) _nbsegs.push_back( intVal );
}
}
isOK = (load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.reserve( intVal );
for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
isOK = (load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
}
isOK = (load >> _objEntry);
return load;
}
//=============================================================================
/*!
*
*/
//=============================================================================
ostream & operator <<(ostream & save, StdMeshers_FixedPoints1D & hyp)
{
return hyp.SaveTo( save );
}
//=============================================================================
/*!
*
*/
//=============================================================================
istream & operator >>(istream & load, StdMeshers_FixedPoints1D & hyp)
{
return hyp.LoadFrom( load );
}
//================================================================================
/*!
* \brief Initialize start and end length by the mesh built on the geometry
* \param theMesh - the built mesh
* \param theShape - the geometry of interest
* \retval bool - true if parameter values have been successfully defined
*/
//================================================================================
bool StdMeshers_FixedPoints1D::SetParametersByMesh(const SMESH_Mesh* theMesh,
const TopoDS_Shape& theShape)
{
if ( !theMesh || theShape.IsNull() )
return false;
_nbsegs.reserve( 1 );
_nbsegs.push_back( 1 );
return true;
}
//================================================================================
/*!
* \brief Initialize my parameter values by default parameters.
* \retval bool - true if parameter values have been successfully defined
*/
//================================================================================
bool StdMeshers_FixedPoints1D::SetParametersByDefaults(const TDefaults& dflts,
const SMESH_Mesh* /*mesh*/)
{
_nbsegs.reserve( 1 );
_nbsegs.push_back( 1 );
return true;
}

View File

@ -0,0 +1,90 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_FixedPoints1D.hxx
// Author : Damien COQUERET, OCC
// Module : SMESH
//
#ifndef _SMESH_FIXEDPOINTS1D_HXX_
#define _SMESH_FIXEDPOINTS1D_HXX_
#include "SMESH_StdMeshers.hxx"
#include "SMESH_Hypothesis.hxx"
#include "Utils_SALOME_Exception.hxx"
#include <vector>
class STDMESHERS_EXPORT StdMeshers_FixedPoints1D:
public SMESH_Hypothesis
{
public:
StdMeshers_FixedPoints1D(int hypId, int studyId, SMESH_Gen* gen);
virtual ~StdMeshers_FixedPoints1D();
void SetPoints(std::vector<double>& listParams)
throw(SALOME_Exception);
void SetNbSegments(std::vector<int>& listNbSeg)
throw(SALOME_Exception);
const std::vector<double>& GetPoints() const { return _params; }
const std::vector<int>& GetNbSegments() const { return _nbsegs; }
void SetReversedEdges( std::vector<int>& ids);
void SetObjectEntry( const char* entry ) { _objEntry = entry; }
const char* GetObjectEntry() { return _objEntry.c_str(); }
const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
virtual std::ostream & SaveTo(std::ostream & save);
virtual std::istream & LoadFrom(std::istream & load);
friend std::ostream& operator << (std::ostream & save, StdMeshers_FixedPoints1D & hyp);
friend std::istream& operator >> (std::istream & load, StdMeshers_FixedPoints1D & hyp);
/*!
* \brief Initialize start and end length by the mesh built on the geometry
* \param theMesh - the built mesh
* \param theShape - the geometry of interest
* \retval bool - true if parameter values have been successfully defined
*/
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
/*!
* \brief Initialize my parameter values by default parameters.
* \retval bool - true if parameter values have been successfully defined
*/
virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
protected:
std::vector<double> _params;
std::vector<int> _nbsegs;
std::vector<int> _edgeIDs;
std::string _objEntry;
};
#endif

View File

@ -0,0 +1,61 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_LayerDistribution2D.cxx
// Author : Edward AGAPOV
// Module : SMESH
//
#include "StdMeshers_LayerDistribution2D.hxx"
#include "utilities.h"
//=============================================================================
/*!
* StdMeshers_LayerDistribution2D::StdMeshers_LayerDistribution2D
*
* Constructor
*/
//=============================================================================
StdMeshers_LayerDistribution2D::StdMeshers_LayerDistribution2D(int hypId,
int studyId,
SMESH_Gen * gen)
: StdMeshers_LayerDistribution(hypId, studyId, gen)
{
_name = "LayerDistribution2D"; // used by RadialQuadrangle_1D2D
_param_algo_dim = 2; // 2D
myHyp = 0;
}
//=============================================================================
/*!
* StdMeshers_LayerDistribution2D::~StdMeshers_LayerDistribution2D
*
* Destructor
*/
//=============================================================================
StdMeshers_LayerDistribution2D::~StdMeshers_LayerDistribution2D()
{
MESSAGE( "StdMeshers_LayerDistribution2D::~StdMeshers_LayerDistribution2D" );
}

View File

@ -0,0 +1,55 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_LayerDistribution2D.hxx
// Author : Edward AGAPOV
// Module : SMESH
//
#ifndef _SMESH_LayerDistribution2D_HXX_
#define _SMESH_LayerDistribution2D_HXX_
#include "StdMeshers_LayerDistribution.hxx"
// =========================================================
// =========================================================
/*!
* This hypothesis is used by "Radial quadrangle" algorithm.
* It specifies 1D hypothesis defining distribution of segments
* between the internal and the external surfaces.
*/
// =========================================================
// =========================================================
class STDMESHERS_EXPORT StdMeshers_LayerDistribution2D
:public StdMeshers_LayerDistribution
{
public:
// Constructor
StdMeshers_LayerDistribution2D(int hypId, int studyId, SMESH_Gen* gen);
// Destructor
virtual ~StdMeshers_LayerDistribution2D();
};
#endif

View File

@ -0,0 +1,63 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NumberOfLayers2D.cxx
// Author : Edward AGAPOV
// Module : SMESH
//
#include "StdMeshers_NumberOfLayers2D.hxx"
#include "utilities.h"
//=============================================================================
/*!
* StdMeshers_NumberOfLayers2D::StdMeshers_NumberOfLayers2D
*
* Constructor
*/
//=============================================================================
StdMeshers_NumberOfLayers2D::StdMeshers_NumberOfLayers2D(int hypId,
int studyId,
SMESH_Gen * gen)
: StdMeshers_NumberOfLayers(hypId, studyId, gen)
{
_name = "NumberOfLayers2D"; // used by RadialQuadrangle_1D2D
_param_algo_dim = 2; // 2D
_nbLayers = 1;
}
//=============================================================================
/*!
* StdMeshers_NumberOfLayers2D::~StdMeshers_NumberOfLayers2D
*
* Destructor
*/
//=============================================================================
StdMeshers_NumberOfLayers2D::~StdMeshers_NumberOfLayers2D()
{
MESSAGE( "StdMeshers_NumberOfLayers2D::~StdMeshers_NumberOfLayers2D" );
}

View File

@ -0,0 +1,54 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_NumberOfLayers2D.hxx
// Author : Edward AGAPOV
// Module : SMESH
//
#ifndef _SMESH_NumberOfLayers2D_HXX_
#define _SMESH_NumberOfLayers2D_HXX_
#include "StdMeshers_NumberOfLayers.hxx"
// =========================================================
// =========================================================
/*!
* This hypothesis is used by "Radial quadrangle" algorithm.
* It specifies number of segments between the internal
* and the external surfaces.
*/
// =========================================================
// =========================================================
class STDMESHERS_EXPORT StdMeshers_NumberOfLayers2D
: public StdMeshers_NumberOfLayers
{
public:
// Constructor
StdMeshers_NumberOfLayers2D(int hypId, int studyId, SMESH_Gen* gen);
// Destructor
virtual ~StdMeshers_NumberOfLayers2D();
};
#endif

View File

@ -1904,6 +1904,10 @@ bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh,
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
meshFaces.push_back(aSubMesh); meshFaces.push_back(aSubMesh);
MapShapeNbElemsItr anIt = aResMap.find(meshFaces[i]); MapShapeNbElemsItr anIt = aResMap.find(meshFaces[i]);
if( anIt == aResMap.end() ) {
NumBase = 0;
break;
}
std::vector<int> aVec = (*anIt).second; std::vector<int> aVec = (*anIt).second;
int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
@ -1912,7 +1916,15 @@ bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh,
} }
} }
if(NumBase==0) return false; if(NumBase==0) {
std::vector<int> aResVec(SMDSEntity_Last);
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
aResMap.insert(std::make_pair(sm,aResVec));
myErrorStatus->myName = COMPERR_ALGO_FAILED;
myErrorStatus->myComment = "Submesh can not be evaluated";
return false;
}
// find number of 1d elems for base face // find number of 1d elems for base face
int nb1d = 0; int nb1d = 0;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,69 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH : implementaion of SMESH idl descriptions
// File : StdMeshers_RadialQuadrangle_1D2D.hxx
// Module : SMESH
//
#ifndef _SMESH_RadialQuadrangle_1D2D_HXX_
#define _SMESH_RadialQuadrangle_1D2D_HXX_
#include "SMESH_StdMeshers.hxx"
#include "SMESH_2D_Algo.hxx"
//#include "SMDS_MeshNode.hxx"
//#include <vector>
//#include <map>
class StdMeshers_NumberOfLayers;
class StdMeshers_LayerDistribution;
class SMESH_MesherHelper;
class gp_Pnt;
class STDMESHERS_EXPORT StdMeshers_RadialQuadrangle_1D2D: public SMESH_2D_Algo
{
public:
StdMeshers_RadialQuadrangle_1D2D(int hypId, int studyId, SMESH_Gen* gen);
virtual ~StdMeshers_RadialQuadrangle_1D2D();
virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape);
virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap);
protected:
bool computeLayerPositions(const gp_Pnt& pIn,
const gp_Pnt& pOut);
const StdMeshers_NumberOfLayers* myNbLayerHypo;
const StdMeshers_LayerDistribution* myDistributionHypo;
SMESH_MesherHelper* myHelper;
std::vector< double > myLayerPositions;
};
#endif

View File

@ -78,6 +78,7 @@ StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId, int studyId,
MESSAGE("StdMeshers_Regular_1D::StdMeshers_Regular_1D"); MESSAGE("StdMeshers_Regular_1D::StdMeshers_Regular_1D");
_name = "Regular_1D"; _name = "Regular_1D";
_shapeType = (1 << TopAbs_EDGE); _shapeType = (1 << TopAbs_EDGE);
_fpHyp = 0;
_compatibleHypothesis.push_back("LocalLength"); _compatibleHypothesis.push_back("LocalLength");
_compatibleHypothesis.push_back("MaxLength"); _compatibleHypothesis.push_back("MaxLength");
@ -85,6 +86,7 @@ StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId, int studyId,
_compatibleHypothesis.push_back("StartEndLength"); _compatibleHypothesis.push_back("StartEndLength");
_compatibleHypothesis.push_back("Deflection1D"); _compatibleHypothesis.push_back("Deflection1D");
_compatibleHypothesis.push_back("Arithmetic1D"); _compatibleHypothesis.push_back("Arithmetic1D");
_compatibleHypothesis.push_back("FixedPoints1D");
_compatibleHypothesis.push_back("AutomaticLength"); _compatibleHypothesis.push_back("AutomaticLength");
_compatibleHypothesis.push_back("QuadraticMesh"); // auxiliary !!! _compatibleHypothesis.push_back("QuadraticMesh"); // auxiliary !!!
@ -218,6 +220,16 @@ bool StdMeshers_Regular_1D::CheckHypothesis
aStatus = SMESH_Hypothesis::HYP_OK; aStatus = SMESH_Hypothesis::HYP_OK;
} }
else if (hypName == "FixedPoints1D") {
_fpHyp = dynamic_cast <const StdMeshers_FixedPoints1D*>(theHyp);
ASSERT(_fpHyp);
_hypType = FIXED_POINTS_1D;
_revEdgesIDs = _fpHyp->GetReversedEdges();
aStatus = SMESH_Hypothesis::HYP_OK;
}
else if (hypName == "StartEndLength") else if (hypName == "StartEndLength")
{ {
const StdMeshers_StartEndLength * hyp = const StdMeshers_StartEndLength * hyp =
@ -773,6 +785,62 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
return true; return true;
} }
case FIXED_POINTS_1D: {
const std::vector<double>& aPnts = _fpHyp->GetPoints();
const std::vector<int>& nbsegs = _fpHyp->GetNbSegments();
int i = 0;
TColStd_SequenceOfReal Params;
for(; i<aPnts.size(); i++) {
if( aPnts[i]<0.0001 || aPnts[i]>0.9999 ) continue;
int j=1;
bool IsExist = false;
for(; j<=Params.Length(); j++) {
if( fabs(aPnts[i]-Params.Value(j)) < 1e-4 ) {
IsExist = true;
break;
}
if( aPnts[i]<Params.Value(j) ) break;
}
if(!IsExist) Params.InsertBefore(j,aPnts[i]);
}
double pf, pl, par2, par1, psize;
if (theReverse) {
pf = l;
pl = f;
}
else {
pf = f;
pl = l;
}
psize = pl - pf;
par1 = pf;
//cout<<"aPnts.size() = "<<aPnts.size()<<" Params.Length() = "
// <<Params.Length()<<" nbsegs.size() = "<<nbsegs.size()<<endl;
for(i=0; i<Params.Length(); i++) {
par2 = pf + Params.Value(i+1)*psize;
int nbseg = ( i > nbsegs.size()-1 ) ? nbsegs[0] : nbsegs[i];
double dp = (par2-par1)/nbseg;
int j = 1;
for(; j<=nbseg; j++) {
double param = par1 + dp*j;
theParams.push_back( param );
}
par1 = par2;
}
// add for last
int nbseg = ( nbsegs.size() > Params.Length() ) ? nbsegs[Params.Length()] : nbsegs[0];
double dp = (pl-par1)/nbseg;
int j = 1;
for(; j<nbseg; j++) {
double param = par1 + dp*j;
theParams.push_back( param );
}
if (theReverse) {
theParams.reverse(); // NPAL18025
}
return true;
}
case DEFLECTION: { case DEFLECTION: {
GCPnts_UniformDeflection Discret(theC3d, _value[ DEFLECTION_IND ], f, l, true); GCPnts_UniformDeflection Discret(theC3d, _value[ DEFLECTION_IND ], f, l, true);
@ -828,15 +896,19 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t
{ {
list< double > params; list< double > params;
bool reversed = false; bool reversed = false;
if ( theMesh.GetShapeToMesh().ShapeType() >= TopAbs_WIRE ) if ( theMesh.GetShapeToMesh().ShapeType() >= TopAbs_WIRE ) {
reversed = ( EE.Orientation() == TopAbs_REVERSED ); reversed = ( EE.Orientation() == TopAbs_REVERSED );
if ( !_mainEdge.IsNull() ) }
if ( !_mainEdge.IsNull() ) {
reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED ); reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
}
else if ( _revEdgesIDs.size() > 0 ) { else if ( _revEdgesIDs.size() > 0 ) {
for ( int i = 0; i < _revEdgesIDs.size(); i++) for ( int i = 0; i < _revEdgesIDs.size(); i++) {
if ( _revEdgesIDs[i] == shapeID ) if ( _revEdgesIDs[i] == shapeID ) {
reversed = !reversed; reversed = !reversed;
} }
}
}
BRepAdaptor_Curve C3d( E ); BRepAdaptor_Curve C3d( E );
double length = EdgeLength( E ); double length = EdgeLength( E );

View File

@ -32,6 +32,8 @@
#include "SMESH_1D_Algo.hxx" #include "SMESH_1D_Algo.hxx"
#include "StdMeshers_FixedPoints1D.hxx"
class Adaptor3d_Curve; class Adaptor3d_Curve;
class TopoDS_Vertex; class TopoDS_Vertex;
class StdMeshers_SegmentLengthAroundVertex; class StdMeshers_SegmentLengthAroundVertex;
@ -97,7 +99,7 @@ protected:
StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh, StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh,
const TopoDS_Vertex & theV); const TopoDS_Vertex & theV);
enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, NONE }; enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, NONE };
enum ValueIndex { enum ValueIndex {
SCALE_FACTOR_IND = 0, SCALE_FACTOR_IND = 0,
@ -123,6 +125,8 @@ protected:
HypothesisType _hypType; HypothesisType _hypType;
const StdMeshers_FixedPoints1D* _fpHyp;
double _value[2]; double _value[2];
int _ivalue[3]; int _ivalue[3];
std::vector<double> _vvalue[1]; std::vector<double> _vvalue[1];

View File

@ -36,7 +36,7 @@ salomeinclude_HEADERS = \
StdMeshersGUI_NbSegmentsCreator.h \ StdMeshersGUI_NbSegmentsCreator.h \
StdMeshersGUI_ObjectReferenceParamWdg.h \ StdMeshersGUI_ObjectReferenceParamWdg.h \
StdMeshersGUI_LayerDistributionParamWdg.h \ StdMeshersGUI_LayerDistributionParamWdg.h \
StdMeshersGUI_EdgeDirectionParamWdg.h \ StdMeshersGUI_FixedPointsParamWdg.h \
StdMeshersGUI_SubShapeSelectorWdg.h StdMeshersGUI_SubShapeSelectorWdg.h
# Libraries targets # Libraries targets
@ -49,7 +49,7 @@ dist_libStdMeshersGUI_la_SOURCES = \
StdMeshersGUI_NbSegmentsCreator.cxx \ StdMeshersGUI_NbSegmentsCreator.cxx \
StdMeshersGUI_ObjectReferenceParamWdg.cxx \ StdMeshersGUI_ObjectReferenceParamWdg.cxx \
StdMeshersGUI_LayerDistributionParamWdg.cxx \ StdMeshersGUI_LayerDistributionParamWdg.cxx \
StdMeshersGUI_EdgeDirectionParamWdg.cxx \ StdMeshersGUI_FixedPointsParamWdg.cxx \
StdMeshersGUI_SubShapeSelectorWdg.cxx StdMeshersGUI_SubShapeSelectorWdg.cxx
MOC_FILES = \ MOC_FILES = \
@ -59,7 +59,7 @@ MOC_FILES = \
StdMeshersGUI_NbSegmentsCreator_moc.cxx \ StdMeshersGUI_NbSegmentsCreator_moc.cxx \
StdMeshersGUI_ObjectReferenceParamWdg_moc.cxx \ StdMeshersGUI_ObjectReferenceParamWdg_moc.cxx \
StdMeshersGUI_LayerDistributionParamWdg_moc.cxx \ StdMeshersGUI_LayerDistributionParamWdg_moc.cxx \
StdMeshersGUI_EdgeDirectionParamWdg_moc.cxx \ StdMeshersGUI_FixedPointsParamWdg_moc.cxx \
StdMeshersGUI_SubShapeSelectorWdg_moc.cxx StdMeshersGUI_SubShapeSelectorWdg_moc.cxx
nodist_libStdMeshersGUI_la_SOURCES= \ nodist_libStdMeshersGUI_la_SOURCES= \

View File

@ -0,0 +1,374 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : StdMeshersGUI_FixedPointsParamWdg.cxx
// Author : Open CASCADE S.A.S.
// SMESH includes
//
#include "StdMeshersGUI_FixedPointsParamWdg.h"
// Qt includes
#include <QPushButton>
#include <QIntValidator>
#include <QGridLayout>
#include <QListWidget>
#include <QListWidgetItem>
#include <QItemDelegate>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QCheckBox>
#include <QLineEdit>
#include <QDoubleSpinBox>
#include <QItemDelegate>
#include <QKeyEvent>
#define SPACING 6
#define MARGIN 0
#define SAME_TEXT "-/-"
/*
* function : Tree Widget Item Delegate
* purpose : Custom item delegate
*/
class StdMeshersGUI_FixedPointsParamWdg::LineDelegate : public QItemDelegate
{
public:
LineDelegate( QTreeWidget* );
~LineDelegate() {}
QWidget* createEditor( QWidget*, const QStyleOptionViewItem&, const QModelIndex& ) const;
void setModelData( QWidget* editor, QAbstractItemModel* model, const QModelIndex& index ) const;
private:
QTreeWidget* myTreeWidget;
};
StdMeshersGUI_FixedPointsParamWdg::LineDelegate::LineDelegate( QTreeWidget* parent )
: QItemDelegate( parent ),
myTreeWidget( parent )
{
}
QWidget* StdMeshersGUI_FixedPointsParamWdg::LineDelegate::createEditor( QWidget* parent,
const QStyleOptionViewItem& option,
const QModelIndex& index ) const
{
QWidget* w = 0;
if ( (index.column() == 1 ) ) {
QSpinBox* sb = new QSpinBox( parent );
sb->setFrame( false );
sb->setRange( 1, 999);
w = sb;
}
return w;
}
void StdMeshersGUI_FixedPointsParamWdg::LineDelegate::setModelData( QWidget* editor,
QAbstractItemModel* model,
const QModelIndex& index ) const
{
model->setData( index, qobject_cast<QSpinBox*>( editor )->value(), Qt::EditRole );
model->setData( index, qobject_cast<QSpinBox*>( editor )->value(), Qt::UserRole );
}
//================================================================================
/*!
* Constructor
*/
//================================================================================
StdMeshersGUI_FixedPointsParamWdg
::StdMeshersGUI_FixedPointsParamWdg( QWidget * parent ):
QWidget( parent )
{
QGridLayout* edgesLayout = new QGridLayout( this );
edgesLayout->setMargin( MARGIN );
edgesLayout->setSpacing( SPACING );
myListWidget = new QListWidget( this );
myTreeWidget = new QTreeWidget( this );
mySpinBox = new QDoubleSpinBox( this );
myAddButton = new QPushButton( tr( "SMESH_BUT_ADD" ), this );
myRemoveButton = new QPushButton( tr( "SMESH_BUT_REMOVE" ), this );
mySameValues = new QCheckBox( tr("SMESH_SAME_NB_SEGMENTS"), this);
myListWidget->setSelectionMode( QListWidget::ExtendedSelection );
myTreeWidget->setColumnCount(2);
myTreeWidget->setHeaderLabels( QStringList() << tr( "SMESH_RANGE" ) << tr( "SMESH_NB_SEGMENTS" ) );
myTreeWidget->setColumnWidth( 1, 40 );
myTreeWidget->setColumnWidth( 2, 30 );
myTreeWidget->setItemDelegate( new LineDelegate( myTreeWidget ) );
edgesLayout->addWidget(myListWidget, 0, 0, 4, 1);
edgesLayout->addWidget(mySpinBox, 0, 1);
edgesLayout->addWidget(myAddButton, 1, 1);
edgesLayout->addWidget(myRemoveButton, 2, 1);
edgesLayout->addWidget(myTreeWidget, 0, 2, 4, 1);
edgesLayout->addWidget(mySameValues, 4, 0, 1, 3);
edgesLayout->setRowStretch( 3, 5 );
edgesLayout->setColumnStretch(0, 1);
edgesLayout->setColumnStretch(1, 0);
edgesLayout->setColumnStretch(2, 2);
myListWidget->setMinimumWidth( 80 );
myTreeWidget->setMinimumWidth( 200 );
mySpinBox->setRange( 0, 1 );
mySpinBox->setSingleStep( 0.1 );
connect( myAddButton, SIGNAL(clicked()), SLOT(onAdd()));
connect( myRemoveButton, SIGNAL(clicked()), SLOT(onRemove()));
connect( mySameValues, SIGNAL(stateChanged(int)), SLOT(onCheckBoxChanged()));
myListWidget->installEventFilter( this );
clear();
}
//================================================================================
/*!
* Destructor
*/
//================================================================================
StdMeshersGUI_FixedPointsParamWdg::~StdMeshersGUI_FixedPointsParamWdg()
{
}
//================================================================================
/*!
* Event filter
*/
//================================================================================
bool StdMeshersGUI_FixedPointsParamWdg::eventFilter( QObject* o, QEvent* e )
{
if ( o == myListWidget && e->type() == QEvent::KeyPress ) {
QKeyEvent* ke = (QKeyEvent*)e;
if ( ke->key() == Qt::Key_Delete )
removePoints();
}
return QWidget::eventFilter( o, e );
}
//================================================================================
/*!
* Clear widget
*/
//================================================================================
void StdMeshersGUI_FixedPointsParamWdg::clear()
{
myTreeWidget->clear();
myListWidget->clear();
myTreeWidget->addTopLevelItem( newTreeItem( 0, 1 ) );
mySpinBox->setValue( 0. );
onCheckBoxChanged();
}
//=================================================================================
// function : onAdd()
// purpose : Called when Add Button Clicked
//=================================================================================
void StdMeshersGUI_FixedPointsParamWdg::onAdd()
{
addPoint( mySpinBox->value() );
}
//=================================================================================
// function : onRemove()
// purpose : Called when Remove Button Clicked
//=================================================================================
void StdMeshersGUI_FixedPointsParamWdg::onRemove()
{
removePoints();
}
//=================================================================================
// function : newTreeItem()
// purpose : Called to create TreeItem
//=================================================================================
QTreeWidgetItem* StdMeshersGUI_FixedPointsParamWdg::newTreeItem( double v1, double v2 )
{
QTreeWidgetItem* anItem = new QTreeWidgetItem();
anItem->setText( 0, treeItemText( v1, v2 ) );
anItem->setText( 1, QString::number( 1 ) );
anItem->setData( 1, Qt::UserRole, 1 );
return anItem;
}
//=================================================================================
// function : newListItem()
// purpose : Called to create ListItem
//=================================================================================
QListWidgetItem* StdMeshersGUI_FixedPointsParamWdg::newListItem( double v )
{
QListWidgetItem* anItem = new QListWidgetItem( QString::number( v ) );
anItem->setData( Qt::UserRole, v );
return anItem;
}
//=================================================================================
// function : itemText()
// purpose : Called to convert Values to Text
//=================================================================================
QString StdMeshersGUI_FixedPointsParamWdg::treeItemText( double v1, double v2 )
{
return QString( "%1 - %2" ).arg( v1 ).arg( v2 );
}
//=================================================================================
// function : addPoint()
// purpose : Called to Add new Point
//=================================================================================
void StdMeshersGUI_FixedPointsParamWdg::addPoint( double v)
{
if ( v > 0 && v < 1) {
bool toInsert = true;
int idx = myTreeWidget->topLevelItemCount()-1;
for ( int i = 0 ; i < myListWidget->count(); i++ ) {
double lv = point( i );
if ( lv == v ) { toInsert = false; break; }
else if ( lv > v ) {
idx = i; break;
}
}
if ( toInsert ) {
double v1 = idx == 0 ? 0 : point( idx-1 );
double v2 = idx == myTreeWidget->topLevelItemCount()-1 ? 1 : point( idx );
myTreeWidget->insertTopLevelItem( idx, newTreeItem( v1, v ) );
myTreeWidget->topLevelItem( idx+1 )->setText( 0, treeItemText( v, v2 ) );
myListWidget->insertItem( idx, newListItem( v ) );
onCheckBoxChanged();
}
}
}
//=================================================================================
// function : removePoints()
// purpose : Called to remove selected points
//=================================================================================
void StdMeshersGUI_FixedPointsParamWdg::removePoints()
{
QList<QListWidgetItem*> selItems = myListWidget->selectedItems();
QListWidgetItem* item;
foreach ( item, selItems ) {
int idx = myListWidget->row( item );
delete myTreeWidget->topLevelItem( idx );
delete item;
myTreeWidget->topLevelItem( idx )->setText( 0, treeItemText( idx == 0 ? 0 : point( idx-1 ),
idx > myListWidget->count()-1 ? 1 : point( idx ) ) );
}
onCheckBoxChanged();
}
double StdMeshersGUI_FixedPointsParamWdg::point( int idx ) const
{
return idx >= 0 && idx < myListWidget->count() ? myListWidget->item( idx )->data( Qt::UserRole ).toDouble() : 0.;
}
void StdMeshersGUI_FixedPointsParamWdg::setNbSegments( int idx, int val )
{
if ( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ) {
myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, val );
myTreeWidget->topLevelItem( idx )->setText( 1, idx > 0 && mySameValues->isChecked() ? QString( SAME_TEXT ) : QString::number( val ) );
}
}
int StdMeshersGUI_FixedPointsParamWdg::nbSegments( int idx ) const
{
return idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toInt() : 1;
}
//=================================================================================
// function : onCheckBoxChanged()
// purpose : Called when Check Box Clicked
//=================================================================================
void StdMeshersGUI_FixedPointsParamWdg::onCheckBoxChanged()
{
for ( int i = 0; i < myTreeWidget->topLevelItemCount(); i++ ) {
QTreeWidgetItem* anItem = myTreeWidget->topLevelItem(i);
setNbSegments( i, nbSegments( i ) );
anItem->setFlags( mySameValues->isChecked() && i > 0 ? anItem->flags() & ~Qt::ItemIsEditable : anItem->flags() | Qt::ItemIsEditable );
}
}
//=================================================================================
// function : GetListOfPoints
// purpose : Called to get the list of Edges IDs
//=================================================================================
SMESH::double_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfPoints()
{
SMESH::double_array_var anArray = new SMESH::double_array;
int size = myListWidget->count();
anArray->length( size );
for (int i = 0; i < size; i++) {
anArray[i] = point(i);
// printf ("Point %f \n", anArray[i]);
}
return anArray;
}
//=================================================================================
// function : SetListOfPoints
// purpose : Called to set the list of Points
//=================================================================================
void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var thePoints)
{
clear();
for ( int i = 0; i < thePoints->length(); i++ ) {
addPoint( thePoints[ i ] );
// printf ("Add Point %f \n", thePoints[ i ]);
}
}
//=================================================================================
// function : GetListOfSegments
// purpose : Called to get the list Number of Segments
//=================================================================================
SMESH::long_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfSegments()
{
SMESH::long_array_var anArray = new SMESH::long_array;
int size = mySameValues->isChecked() ? 1 : myTreeWidget->topLevelItemCount();
anArray->length( size );
for (int i = 0; i < size; i++) {
anArray[i] = nbSegments( i );
// printf ("Segments %d \n", anArray[i] );
}
return anArray;
}
//=================================================================================
// function : SetListOfPoints
// purpose : Called to set the list of Points
//=================================================================================
void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var theSegments)
{
if ( myListWidget->count() > 0 && theSegments->length() == 1)
mySameValues->setChecked(true);
for ( int i = 0; i < theSegments->length(); i++ ) {
setNbSegments( i, theSegments[i] );
// printf ("\nadd Segment = %d\n", theSegments[i]);
}
}

View File

@ -0,0 +1,93 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// File : StdMeshersGUI_FixedPointsParamWdg.h
// Author : Open CASCADE S.A.S. (dmv)
//
#ifndef STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H
#define STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H
// SMESH includes
#include <SMESHGUI.h>
#include "SMESH_StdMeshersGUI.hxx"
// Qt includes
#include <QWidget>
#include <QStringList>
class SMESHGUI;
class QPushButton;
class QLineEdit;
class QCheckBox;
class QDoubleSpinBox;
class QListWidget;
class QListWidgetItem;
class QTreeWidget;
class QTreeWidgetItem;
class STDMESHERSGUI_EXPORT StdMeshersGUI_FixedPointsParamWdg : public QWidget
{
Q_OBJECT
class LineDelegate;
public:
StdMeshersGUI_FixedPointsParamWdg( QWidget* parent = 0 );
~StdMeshersGUI_FixedPointsParamWdg();
bool eventFilter( QObject*, QEvent* );
SMESH::double_array_var GetListOfPoints();
void SetListOfPoints( SMESH::double_array_var );
SMESH::long_array_var GetListOfSegments();
void SetListOfSegments( SMESH::long_array_var );
QString GetValue() const { return myParamValue; }
private slots:
void onAdd();
void onRemove();
void onCheckBoxChanged();
private:
void clear();
void addPoint( double );
void removePoints();
double point( int ) const;
void setNbSegments( int, int );
int nbSegments( int ) const;
static QTreeWidgetItem* newTreeItem( double v1, double v2 );
static QListWidgetItem* newListItem( double v1 );
static QString treeItemText( double v1, double v2 );
private:
QListWidget* myListWidget;
QTreeWidget* myTreeWidget;
QDoubleSpinBox* mySpinBox;
QPushButton* myAddButton;
QPushButton* myRemoveButton;
QCheckBox* mySameValues;
QString myParamValue;
};
#endif // STDMESHERSGUI_FIXEDPOINTSPARAMWGD_H

View File

@ -33,8 +33,8 @@
#include <SMESH_NumberFilter.hxx> #include <SMESH_NumberFilter.hxx>
#include "StdMeshersGUI_ObjectReferenceParamWdg.h" #include "StdMeshersGUI_ObjectReferenceParamWdg.h"
#include "StdMeshersGUI_LayerDistributionParamWdg.h" #include "StdMeshersGUI_LayerDistributionParamWdg.h"
//#include "StdMeshersGUI_EdgeDirectionParamWdg.h"
#include "StdMeshersGUI_SubShapeSelectorWdg.h" #include "StdMeshersGUI_SubShapeSelectorWdg.h"
#include "StdMeshersGUI_FixedPointsParamWdg.h"
#include <SALOMEDSClient_Study.hxx> #include <SALOMEDSClient_Study.hxx>
// SALOME GUI includes // SALOME GUI includes
@ -378,7 +378,7 @@ bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
if ( ok ) if ( ok )
deactivateObjRefParamWdg( customWidgets() ); deactivateObjRefParamWdg( customWidgets() );
} }
else if ( hypType() == "LayerDistribution" ) else if ( hypType() == "LayerDistribution" || hypType() == "LayerDistribution2D" )
{ {
StdMeshersGUI_LayerDistributionParamWdg* w = StdMeshersGUI_LayerDistributionParamWdg* w =
widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 ); widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
@ -446,8 +446,6 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
StdMeshers::StdMeshers_Arithmetic1D_var h = StdMeshers::StdMeshers_Arithmetic1D_var h =
StdMeshers::StdMeshers_Arithmetic1D::_narrow( hypothesis() ); StdMeshers::StdMeshers_Arithmetic1D::_narrow( hypothesis() );
//StdMeshersGUI_EdgeDirectionParamWdg* w =
// widget< StdMeshersGUI_EdgeDirectionParamWdg >( 2 );
StdMeshersGUI_SubShapeSelectorWdg* w = StdMeshersGUI_SubShapeSelectorWdg* w =
widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 ); widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
@ -461,6 +459,28 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
h->SetObjectEntry( entry ); h->SetObjectEntry( entry );
} }
} }
else if( hypType()=="FixedPoints1D" )
{
StdMeshers::StdMeshers_FixedPoints1D_var h =
StdMeshers::StdMeshers_FixedPoints1D::_narrow( hypothesis() );
StdMeshersGUI_FixedPointsParamWdg* w1 =
widget< StdMeshersGUI_FixedPointsParamWdg >( 0 );
StdMeshersGUI_SubShapeSelectorWdg* w2 =
widget< StdMeshersGUI_SubShapeSelectorWdg >( 1 );
if (w1) {
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
h->SetPoints( w1->GetListOfPoints() );
h->SetNbSegments( w1->GetListOfSegments() );
}
if (w2) {
h->SetReversedEdges( w2->GetListOfIDs() );
const char * entry = w2->GetMainShapeEntry();
h->SetObjectEntry( entry );
}
}
else if( hypType()=="MaxElementArea" ) else if( hypType()=="MaxElementArea" )
{ {
StdMeshers::StdMeshers_MaxElementArea_var h = StdMeshers::StdMeshers_MaxElementArea_var h =
@ -526,6 +546,25 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
h->SetParameters(w->GetHypothesis()->GetParameters()); h->SetParameters(w->GetHypothesis()->GetParameters());
w->GetHypothesis()->ClearParameters(); w->GetHypothesis()->ClearParameters();
} }
else if( hypType()=="NumberOfLayers2D" )
{
StdMeshers::StdMeshers_NumberOfLayers2D_var h =
StdMeshers::StdMeshers_NumberOfLayers2D::_narrow( hypothesis() );
h->SetNumberOfLayers( params[0].myValue.toInt() );
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
}
else if( hypType()=="LayerDistribution2D" )
{
StdMeshers::StdMeshers_LayerDistribution2D_var h =
StdMeshers::StdMeshers_LayerDistribution2D::_narrow( hypothesis() );
StdMeshersGUI_LayerDistributionParamWdg* w =
widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
h->SetLayerDistribution( w->GetHypothesis() );
h->SetParameters(w->GetHypothesis()->GetParameters());
w->GetHypothesis()->ClearParameters();
}
else if( hypType()=="ProjectionSource1D" ) else if( hypType()=="ProjectionSource1D" )
{ {
StdMeshers::StdMeshers_ProjectionSource1D_var h = StdMeshers::StdMeshers_ProjectionSource1D_var h =
@ -692,11 +731,9 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
customWidgets()->append (0); customWidgets()->append (0);
item.myName = tr( "SMESH_REVERCE_EDGES" ); item.myName = tr( "SMESH_REVERSED_EDGES" );
p.append( item ); p.append( item );
//StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget =
// new StdMeshersGUI_EdgeDirectionParamWdg();
StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget = StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
new StdMeshersGUI_SubShapeSelectorWdg(); new StdMeshersGUI_SubShapeSelectorWdg();
QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry(); QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
@ -707,6 +744,40 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
aDirectionWidget->showPreview( true ); aDirectionWidget->showPreview( true );
customWidgets()->append ( aDirectionWidget ); customWidgets()->append ( aDirectionWidget );
} }
else if( hypType()=="FixedPoints1D" )
{
StdMeshers::StdMeshers_FixedPoints1D_var h =
StdMeshers::StdMeshers_FixedPoints1D::_narrow( hyp );
item.myName = tr( "SMESH_FIXED_POINTS" );
p.append( item );
StdMeshersGUI_FixedPointsParamWdg* aFixedPointsWidget =
new StdMeshersGUI_FixedPointsParamWdg();
if ( !isCreation() ) {
aFixedPointsWidget->SetListOfPoints( h->GetPoints() );
aFixedPointsWidget->SetListOfSegments( h->GetNbSegments() );
}
customWidgets()->append( aFixedPointsWidget );
item.myName = tr( "SMESH_REVERSED_EDGES" );
p.append( item );
StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
new StdMeshersGUI_SubShapeSelectorWdg();
QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
if ( anEntry == "" )
anEntry = h->GetObjectEntry();
aDirectionWidget->SetMainShapeEntry( anEntry );
aDirectionWidget->SetListOfIDs( h->GetReversedEdges() );
aDirectionWidget->showPreview( true );
customWidgets()->append ( aDirectionWidget );
}
else if( hypType()=="MaxElementArea" ) else if( hypType()=="MaxElementArea" )
{ {
StdMeshers::StdMeshers_MaxElementArea_var h = StdMeshers::StdMeshers_MaxElementArea_var h =
@ -746,11 +817,9 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
p.append( item ); p.append( item );
customWidgets()->append(0); customWidgets()->append(0);
item.myName = tr( "SMESH_REVERCE_EDGES" ); item.myName = tr( "SMESH_REVERSED_EDGES" );
p.append( item ); p.append( item );
//StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget =
// new StdMeshersGUI_EdgeDirectionParamWdg();
StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget = StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
new StdMeshersGUI_SubShapeSelectorWdg(); new StdMeshersGUI_SubShapeSelectorWdg();
QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry(); QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
@ -793,8 +862,7 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
item.myValue = (int) h->GetNumberOfLayers(); item.myValue = (int) h->GetNumberOfLayers();
p.append( item ); p.append( item );
} }
else if( hypType()=="LayerDistribution" ) else if( hypType()=="LayerDistribution" ) {
{
StdMeshers::StdMeshers_LayerDistribution_var h = StdMeshers::StdMeshers_LayerDistribution_var h =
StdMeshers::StdMeshers_LayerDistribution::_narrow( hyp ); StdMeshers::StdMeshers_LayerDistribution::_narrow( hyp );
@ -811,6 +879,32 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
customWidgets()->append customWidgets()->append
( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg())); ( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg()));
} }
else if( hypType()=="NumberOfLayers2D" ) {
StdMeshers::StdMeshers_NumberOfLayers2D_var h =
StdMeshers::StdMeshers_NumberOfLayers2D::_narrow( hyp );
item.myName = tr( "SMESH_NUMBER_OF_LAYERS" );
if(!initVariableName(aParameters,item,0))
item.myValue = (int) h->GetNumberOfLayers();
p.append( item );
}
else if( hypType()=="LayerDistribution2D" ) {
StdMeshers::StdMeshers_LayerDistribution2D_var h =
StdMeshers::StdMeshers_LayerDistribution2D::_narrow( hyp );
item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item );
//Set into not published hypo last variables
QStringList aLastVarsList;
for(int i = 0;i<aParameters->length();i++)
aLastVarsList.append(QString(aParameters[i].in()));
if(!aLastVarsList.isEmpty())
h->GetLayerDistribution()->SetLastParameters(SMESHGUI::JoinObjectParameters(aLastVarsList));
customWidgets()->append
( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), hypName(), dlg()));
}
else if( hypType()=="ProjectionSource1D" ) else if( hypType()=="ProjectionSource1D" )
{ {
StdMeshers::StdMeshers_ProjectionSource1D_var h = StdMeshers::StdMeshers_ProjectionSource1D_var h =
@ -1015,12 +1109,15 @@ QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) cons
types.insert( "StartEndLength", "START_END_LENGTH" ); types.insert( "StartEndLength", "START_END_LENGTH" );
types.insert( "Deflection1D", "DEFLECTION1D" ); types.insert( "Deflection1D", "DEFLECTION1D" );
types.insert( "Arithmetic1D", "ARITHMETIC_1D" ); types.insert( "Arithmetic1D", "ARITHMETIC_1D" );
types.insert( "FixedPoints1D", "FIXED_POINTS_1D" );
types.insert( "AutomaticLength", "AUTOMATIC_LENGTH" ); types.insert( "AutomaticLength", "AUTOMATIC_LENGTH" );
types.insert( "ProjectionSource1D", "PROJECTION_SOURCE_1D" ); types.insert( "ProjectionSource1D", "PROJECTION_SOURCE_1D" );
types.insert( "ProjectionSource2D", "PROJECTION_SOURCE_2D" ); types.insert( "ProjectionSource2D", "PROJECTION_SOURCE_2D" );
types.insert( "ProjectionSource3D", "PROJECTION_SOURCE_3D" ); types.insert( "ProjectionSource3D", "PROJECTION_SOURCE_3D" );
types.insert( "NumberOfLayers", "NUMBER_OF_LAYERS" ); types.insert( "NumberOfLayers", "NUMBER_OF_LAYERS" );
types.insert( "LayerDistribution", "LAYER_DISTRIBUTION" ); types.insert( "LayerDistribution", "LAYER_DISTRIBUTION" );
types.insert( "NumberOfLayers2D", "NUMBER_OF_LAYERS" );
types.insert( "LayerDistribution2D", "LAYER_DISTRIBUTION" );
types.insert( "SegmentLengthAroundVertex", "SEGMENT_LENGTH_AROUND_VERTEX" ); types.insert( "SegmentLengthAroundVertex", "SEGMENT_LENGTH_AROUND_VERTEX" );
types.insert( "MaxLength", "MAX_LENGTH" ); types.insert( "MaxLength", "MAX_LENGTH" );
types.insert( "QuadrangleParams", "QUADRANGLE_PARAMS" ); types.insert( "QuadrangleParams", "QUADRANGLE_PARAMS" );
@ -1096,13 +1193,6 @@ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & pa
param.myValue = w->GetValue(); param.myValue = w->GetValue();
return true; return true;
} }
//if ( widget->inherits( "StdMeshersGUI_EdgeDirectionParamWdg" ))
//{
// const StdMeshersGUI_EdgeDirectionParamWdg * w =
// static_cast<const StdMeshersGUI_EdgeDirectionParamWdg*>( widget );
// param.myValue = w->GetValue();
// return true;
//}
if ( widget->inherits( "StdMeshersGUI_SubShapeSelectorWdg" )) if ( widget->inherits( "StdMeshersGUI_SubShapeSelectorWdg" ))
{ {
const StdMeshersGUI_SubShapeSelectorWdg * w = const StdMeshersGUI_SubShapeSelectorWdg * w =
@ -1110,6 +1200,13 @@ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & pa
param.myValue = w->GetValue(); param.myValue = w->GetValue();
return true; return true;
} }
if ( widget->inherits( "StdMeshersGUI_FixedPointsParamWdg" ))
{
const StdMeshersGUI_FixedPointsParamWdg * w =
static_cast<const StdMeshersGUI_FixedPointsParamWdg*>( widget );
param.myValue = w->GetValue();
return true;
}
return false; return false;
} }

View File

@ -29,6 +29,10 @@
<source>ICON_DLG_ARITHMETIC_1D</source> <source>ICON_DLG_ARITHMETIC_1D</source>
<translation>mesh_hypo_length.png</translation> <translation>mesh_hypo_length.png</translation>
</message> </message>
<message>
<source>ICON_DLG_FIXED_POINTS_1D</source>
<translation>mesh_hypo_length.png</translation>
</message>
<message> <message>
<source>ICON_DLG_AUTOMATIC_LENGTH</source> <source>ICON_DLG_AUTOMATIC_LENGTH</source>
<translation>mesh_hypo_length.png</translation> <translation>mesh_hypo_length.png</translation>

View File

@ -149,6 +149,14 @@
<source>SMESH_LOCAL_LENGTH_TITLE</source> <source>SMESH_LOCAL_LENGTH_TITLE</source>
<translation>Hypothesis Construction</translation> <translation>Hypothesis Construction</translation>
</message> </message>
<message>
<source>SMESH_FIXED_POINTS_1D_HYPOTHESIS</source>
<translation>Fixed points 1D</translation>
</message>
<message>
<source>SMESH_FIXED_POINTS_1D_TITLE</source>
<translation>Hypothesis Construction</translation>
</message>
<message> <message>
<source>SMESH_MAX_LENGTH_HYPOTHESIS</source> <source>SMESH_MAX_LENGTH_HYPOTHESIS</source>
<translation>Max Length</translation> <translation>Max Length</translation>
@ -246,8 +254,24 @@
<translation>Remove row</translation> <translation>Remove row</translation>
</message> </message>
<message> <message>
<source>SMESH_REVERCE_EDGES</source> <source>SMESH_REVERSED_EDGES</source>
<translation>Reverce Edges</translation> <translation>Reversed Edges</translation>
</message>
<message>
<source>SMESH_FIXED_POINTS</source>
<translation>Fixed Points</translation>
</message>
<message>
<source>SMESH_RANGE</source>
<translation>Range</translation>
</message>
<message>
<source>SMESH_NB_SEGMENTS</source>
<translation>Nb. Segments</translation>
</message>
<message>
<source>SMESH_SAME_NB_SEGMENTS</source>
<translation>Same Nb. Segments for All Intervals</translation>
</message> </message>
<message> <message>
<source>SMESH_BASE_VERTEX</source> <source>SMESH_BASE_VERTEX</source>

View File

@ -32,6 +32,7 @@ salomeinclude_HEADERS = \
StdMeshers_LocalLength_i.hxx \ StdMeshers_LocalLength_i.hxx \
StdMeshers_StartEndLength_i.hxx \ StdMeshers_StartEndLength_i.hxx \
StdMeshers_Arithmetic1D_i.hxx \ StdMeshers_Arithmetic1D_i.hxx \
StdMeshers_FixedPoints1D_i.hxx \
StdMeshers_NumberOfSegments_i.hxx \ StdMeshers_NumberOfSegments_i.hxx \
StdMeshers_Deflection1D_i.hxx \ StdMeshers_Deflection1D_i.hxx \
StdMeshers_Propagation_i.hxx \ StdMeshers_Propagation_i.hxx \
@ -47,6 +48,7 @@ salomeinclude_HEADERS = \
StdMeshers_QuadranglePreference_i.hxx \ StdMeshers_QuadranglePreference_i.hxx \
StdMeshers_QuadraticMesh_i.hxx \ StdMeshers_QuadraticMesh_i.hxx \
StdMeshers_NumberOfLayers_i.hxx \ StdMeshers_NumberOfLayers_i.hxx \
StdMeshers_NumberOfLayers2D_i.hxx \
StdMeshers_Prism_3D_i.hxx \ StdMeshers_Prism_3D_i.hxx \
StdMeshers_ProjectionSource1D_i.hxx \ StdMeshers_ProjectionSource1D_i.hxx \
StdMeshers_ProjectionSource2D_i.hxx \ StdMeshers_ProjectionSource2D_i.hxx \
@ -54,6 +56,7 @@ salomeinclude_HEADERS = \
StdMeshers_Projection_1D_2D_3D_i.hxx \ StdMeshers_Projection_1D_2D_3D_i.hxx \
StdMeshers_ObjRefUlils.hxx \ StdMeshers_ObjRefUlils.hxx \
StdMeshers_LayerDistribution_i.hxx \ StdMeshers_LayerDistribution_i.hxx \
StdMeshers_LayerDistribution2D_i.hxx \
StdMeshers_CompositeSegment_1D_i.hxx \ StdMeshers_CompositeSegment_1D_i.hxx \
StdMeshers_SegmentAroundVertex_0D_i.hxx \ StdMeshers_SegmentAroundVertex_0D_i.hxx \
StdMeshers_SegmentLengthAroundVertex_i.hxx \ StdMeshers_SegmentLengthAroundVertex_i.hxx \
@ -61,6 +64,7 @@ salomeinclude_HEADERS = \
StdMeshers_TrianglePreference_i.hxx \ StdMeshers_TrianglePreference_i.hxx \
StdMeshers_MaxLength_i.hxx \ StdMeshers_MaxLength_i.hxx \
StdMeshers_QuadrangleParams_i.hxx \ StdMeshers_QuadrangleParams_i.hxx \
StdMeshers_RadialQuadrangle_1D2D_i.hxx \
SMESH_StdMeshers_I.hxx SMESH_StdMeshers_I.hxx
# Libraries targets # Libraries targets
@ -71,6 +75,7 @@ dist_libStdMeshersEngine_la_SOURCES = \
StdMeshers_LocalLength_i.cxx \ StdMeshers_LocalLength_i.cxx \
StdMeshers_StartEndLength_i.cxx \ StdMeshers_StartEndLength_i.cxx \
StdMeshers_Arithmetic1D_i.cxx \ StdMeshers_Arithmetic1D_i.cxx \
StdMeshers_FixedPoints1D_i.cxx \
StdMeshers_NumberOfSegments_i.cxx \ StdMeshers_NumberOfSegments_i.cxx \
StdMeshers_Deflection1D_i.cxx \ StdMeshers_Deflection1D_i.cxx \
StdMeshers_Propagation_i.cxx \ StdMeshers_Propagation_i.cxx \
@ -86,6 +91,7 @@ dist_libStdMeshersEngine_la_SOURCES = \
StdMeshers_QuadranglePreference_i.cxx \ StdMeshers_QuadranglePreference_i.cxx \
StdMeshers_QuadraticMesh_i.cxx \ StdMeshers_QuadraticMesh_i.cxx \
StdMeshers_NumberOfLayers_i.cxx \ StdMeshers_NumberOfLayers_i.cxx \
StdMeshers_NumberOfLayers2D_i.cxx \
StdMeshers_Prism_3D_i.cxx \ StdMeshers_Prism_3D_i.cxx \
StdMeshers_ProjectionSource1D_i.cxx \ StdMeshers_ProjectionSource1D_i.cxx \
StdMeshers_ProjectionSource2D_i.cxx \ StdMeshers_ProjectionSource2D_i.cxx \
@ -93,13 +99,15 @@ dist_libStdMeshersEngine_la_SOURCES = \
StdMeshers_Projection_1D_2D_3D_i.cxx \ StdMeshers_Projection_1D_2D_3D_i.cxx \
StdMeshers_ObjRefUlils.cxx \ StdMeshers_ObjRefUlils.cxx \
StdMeshers_LayerDistribution_i.cxx \ StdMeshers_LayerDistribution_i.cxx \
StdMeshers_LayerDistribution2D_i.cxx \
StdMeshers_CompositeSegment_1D_i.cxx \ StdMeshers_CompositeSegment_1D_i.cxx \
StdMeshers_SegmentAroundVertex_0D_i.cxx \ StdMeshers_SegmentAroundVertex_0D_i.cxx \
StdMeshers_SegmentLengthAroundVertex_i.cxx \ StdMeshers_SegmentLengthAroundVertex_i.cxx \
StdMeshers_UseExisting_1D2D_i.cxx \ StdMeshers_UseExisting_1D2D_i.cxx \
StdMeshers_TrianglePreference_i.cxx \ StdMeshers_TrianglePreference_i.cxx \
StdMeshers_MaxLength_i.cxx \ StdMeshers_MaxLength_i.cxx \
StdMeshers_QuadrangleParams_i.cxx StdMeshers_QuadrangleParams_i.cxx \
StdMeshers_RadialQuadrangle_1D2D_i.cxx
# additionnal information to compil and link file # additionnal information to compil and link file
libStdMeshersEngine_la_CPPFLAGS = \ libStdMeshersEngine_la_CPPFLAGS = \

View File

@ -0,0 +1,290 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_FixedPoints1D_i.cxx
// Author : Damien COQUERET, OCC
// Module : SMESH
// $Header$
//
#include "StdMeshers_FixedPoints1D_i.hxx"
#include "SMESH_Gen_i.hxx"
#include "SMESH_Gen.hxx"
#include "SMESH_PythonDump.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
#include <TCollection_AsciiString.hxx>
using namespace std;
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i
*
* Constructor
*/
//=============================================================================
StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl )
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_FixedPoints1D_i::StdMeshers_FixedPoints1D_i" );
myBaseImpl = new ::StdMeshers_FixedPoints1D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::~StdMeshers_FixedPoints1D_i
*
* Destructor
*/
//=============================================================================
StdMeshers_FixedPoints1D_i::~StdMeshers_FixedPoints1D_i()
{
MESSAGE( "StdMeshers_FixedPoints1D_i::~StdMeshers_FixedPoints1D_i" );
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::SetNbSegments
*/
//=============================================================================
void StdMeshers_FixedPoints1D_i::SetNbSegments(const SMESH::long_array& listNbSeg)
throw ( SALOME::SALOME_Exception )
{
MESSAGE( "StdMeshers_FixedPoints1D_i::SetNbSegments" );
ASSERT( myBaseImpl );
try {
std::vector<int> nbsegs( listNbSeg.length() );
CORBA::Long iEnd = listNbSeg.length();
for ( CORBA::Long i = 0; i < iEnd; i++ )
nbsegs[ i ] = listNbSeg[ i ];
this->GetImpl()->SetNbSegments( nbsegs );
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
SALOME::BAD_PARAM );
}
// Update Python script
SMESH::TPythonDump() << _this() << ".SetNbSegments( " << listNbSeg << " )";
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::SetPoints
*/
//=============================================================================
void StdMeshers_FixedPoints1D_i::SetPoints(const SMESH::double_array& listParams)
throw ( SALOME::SALOME_Exception )
{
MESSAGE( "StdMeshers_FixedPoints1D_i::SetPoints" );
ASSERT( myBaseImpl );
try {
std::vector<double> params( listParams.length() );
CORBA::Long iEnd = listParams.length();
for ( CORBA::Long i = 0; i < iEnd; i++ )
params[ i ] = listParams[ i ];
this->GetImpl()->SetPoints( params );
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
SALOME::BAD_PARAM );
}
// Update Python script
SMESH::TPythonDump() << _this() << ".SetPoints( " << listParams << " )";
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::GetPoints
*
* Get list of point's parameters
*/
//=============================================================================
SMESH::double_array* StdMeshers_FixedPoints1D_i::GetPoints()
{
MESSAGE( "StdMeshers_FixedPoints1D_i::GetPoints" );
ASSERT( myBaseImpl );
SMESH::double_array_var anArray = new SMESH::double_array;
std::vector<double> params = this->GetImpl()->GetPoints();
anArray->length( params.size() );
for ( CORBA::Long i = 0; i < params.size(); i++)
anArray [ i ] = params [ i ];
return anArray._retn();
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::GetNbSegments
*
* Get list of point's parameters
*/
//=============================================================================
SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments()
{
MESSAGE( "StdMeshers_FixedPoints1D_i::GetNbSegments" );
ASSERT( myBaseImpl );
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> nbsegs = this->GetImpl()->GetNbSegments();
anArray->length( nbsegs.size() );
for ( CORBA::Long i = 0; i < nbsegs.size(); i++)
anArray [ i ] = nbsegs [ i ];
return anArray._retn();
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::SetReversedEdges
*
* Set edges to reverse
*/
//=============================================================================
void StdMeshers_FixedPoints1D_i::SetReversedEdges( const SMESH::long_array& theIds )
{
ASSERT( myBaseImpl );
try {
std::vector<int> ids( theIds.length() );
CORBA::Long iEnd = theIds.length();
for ( CORBA::Long i = 0; i < iEnd; i++ )
ids[ i ] = theIds[ i ];
this->GetImpl()->SetReversedEdges( ids );
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
SALOME::BAD_PARAM );
}
// Update Python script
SMESH::TPythonDump() << _this() << ".SetReversedEdges( " << theIds << " )";
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::SetObjectEntry
*
* Set the Entry for the Main Object
*/
//=============================================================================
void StdMeshers_FixedPoints1D_i::SetObjectEntry( const char* theEntry )
{
ASSERT( myBaseImpl );
string entry(theEntry); // actually needed as theEntry is spoiled by moment of dumping
try {
this->GetImpl()->SetObjectEntry( entry.c_str() );
// Update Python script
SMESH::TPythonDump() << _this() << ".SetObjectEntry( \"" << entry.c_str() << "\" )";
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),SALOME::BAD_PARAM );
}
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::GetObjectEntry
*
* Set the Entry for the Main Object
*/
//=============================================================================
char* StdMeshers_FixedPoints1D_i::GetObjectEntry()
{
MESSAGE( "StdMeshers_FixedPoints1D_i::SetObjectEntry" );
ASSERT( myBaseImpl );
const char* entry;
try {
entry = this->GetImpl()->GetObjectEntry();
}
catch ( SALOME_Exception& S_ex ) {
THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
SALOME::BAD_PARAM );
}
return CORBA::string_dup( entry );
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::GetReversedEdges
*
* Get reversed edges
*/
//=============================================================================
SMESH::long_array* StdMeshers_FixedPoints1D_i::GetReversedEdges()
{
MESSAGE( "StdMeshers_FixedPoints1D_i::GetReversedEdges" );
ASSERT( myBaseImpl );
SMESH::long_array_var anArray = new SMESH::long_array;
std::vector<int> ids = this->GetImpl()->GetReversedEdges();
anArray->length( ids.size() );
for ( CORBA::Long i = 0; i < ids.size(); i++)
anArray [ i ] = ids [ i ];
return anArray._retn();
}
//=============================================================================
/*!
* StdMeshers_FixedPoints1D_i::GetImpl
*
* Get implementation
*/
//=============================================================================
::StdMeshers_FixedPoints1D* StdMeshers_FixedPoints1D_i::GetImpl()
{
MESSAGE( "StdMeshers_FixedPoints1D_i::GetImpl" );
return ( ::StdMeshers_FixedPoints1D* )myBaseImpl;
}
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
* \param type - dimension (see SMESH::Dimension enumeration)
* \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
*
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
CORBA::Boolean StdMeshers_FixedPoints1D_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_1D;
}

View File

@ -0,0 +1,87 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_FixedPoints1D_i.hxx
// Author : Damien COQUERET, OCC
// Module : SMESH
//
#ifndef _SMESH_FIXEDPOINTS1D_I_HXX_
#define _SMESH_FIXEDPOINTS1D_I_HXX_
#include "SMESH_StdMeshers_I.hxx"
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
#include "SMESH_Hypothesis_i.hxx"
#include "StdMeshers_FixedPoints1D.hxx"
// ======================================================
// Fixed points 1D hypothesis
// ======================================================
class STDMESHERS_I_EXPORT StdMeshers_FixedPoints1D_i:
public virtual POA_StdMeshers::StdMeshers_FixedPoints1D,
public virtual SMESH_Hypothesis_i
{
public:
// Constructor
StdMeshers_FixedPoints1D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_FixedPoints1D_i();
// Sets some points on edge using parameter on curve from 0 to 1
// (additionally it is neecessary to check orientation of edges and
// create list of reversed edges if it is needed) and sets numbers
// of segments between given points (default values are equals 1)
void SetPoints(const SMESH::double_array& listParams)
throw ( SALOME::SALOME_Exception );
void SetNbSegments(const SMESH::long_array& listNbSeg)
throw ( SALOME::SALOME_Exception );
// Returns list of point's parameters
SMESH::double_array* GetPoints();
// Returns list of numbers of segments
SMESH::long_array* GetNbSegments();
//Set Reversed Edges
void SetReversedEdges( const SMESH::long_array& theIDs);
//Get Reversed Edges
SMESH::long_array* GetReversedEdges();
//Set the Entry of the Object
void SetObjectEntry( const char* theEntry);
//Get Object Entry
char* GetObjectEntry();
// Get implementation
::StdMeshers_FixedPoints1D* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
};
#endif

View File

@ -0,0 +1,95 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_LayerDistribution2D_i.cxx
// Author : Edward AGAPOV
// Module : SMESH
// $Header$
//
#include "StdMeshers_LayerDistribution2D_i.hxx"
#include "utilities.h"
//using namespace std;
//=============================================================================
/*!
* StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i
*
* Constructor
*/
//=============================================================================
StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i
(PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl )
: StdMeshers_LayerDistribution_i(thePOA,theStudyId,theGenImpl),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE( "StdMeshers_LayerDistribution2D_i::StdMeshers_LayerDistribution2D_i" );
myBaseImpl = new ::StdMeshers_LayerDistribution2D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
}
//=============================================================================
/*!
* StdMeshers_LayerDistribution2D_i::~StdMeshers_LayerDistribution2D_i
*
* Destructor
*/
//=============================================================================
StdMeshers_LayerDistribution2D_i::~StdMeshers_LayerDistribution2D_i()
{
MESSAGE("StdMeshers_LayerDistribution2D_i::~StdMeshers_LayerDistribution2D_i");
}
//=============================================================================
/*!
* StdMeshers_LayerDistribution2D_i::GetImpl
*
* Get implementation
*/
//=============================================================================
::StdMeshers_LayerDistribution2D* StdMeshers_LayerDistribution2D_i::GetImpl()
{
return ( ::StdMeshers_LayerDistribution2D* )myBaseImpl;
}
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
* \param type - dimension (see SMESH::Dimension enumeration)
* \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
*
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
CORBA::Boolean StdMeshers_LayerDistribution2D_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_2D;
}

View File

@ -0,0 +1,64 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_LayerDistribution2D_i.hxx
// Author : Edward AGAPOV
// Module : SMESH
// $Header$
//
#ifndef _SMESH_LayerDistribution2D_I_HXX_
#define _SMESH_LayerDistribution2D_I_HXX_
#include "StdMeshers_LayerDistribution_i.hxx"
#include "StdMeshers_LayerDistribution2D.hxx"
// =========================================================
/*!
* This hypothesis is used by "Radial quadrangle" algorithm.
* It specifies 1D hypothesis defining distribution of segments
* between the internal and the external surfaces.
*/
// =========================================================
class StdMeshers_LayerDistribution2D_i:
public virtual POA_StdMeshers::StdMeshers_LayerDistribution2D,
public virtual StdMeshers_LayerDistribution_i
{
public:
// Constructor
StdMeshers_LayerDistribution2D_i(PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_LayerDistribution2D_i();
// Get implementation
::StdMeshers_LayerDistribution2D* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
};
#endif

View File

@ -0,0 +1,94 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes
// File : StdMeshers_NumberOfLayers2D_i.cxx
// Author : Edward AGAPOV
// Module : SMESH
// $Header$
//
#include "StdMeshers_NumberOfLayers2D_i.hxx"
#include "utilities.h"
//using namespace std;
//=============================================================================
/*!
* StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i
*
* Constructor
*/
//=============================================================================
StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i
(PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl)
: StdMeshers_NumberOfLayers_i(thePOA,theStudyId,theGenImpl),
SMESH_Hypothesis_i( thePOA )
{
MESSAGE("StdMeshers_NumberOfLayers2D_i::StdMeshers_NumberOfLayers2D_i");
myBaseImpl = new ::StdMeshers_NumberOfLayers2D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl);
}
//=============================================================================
/*!
* StdMeshers_NumberOfLayers2D_i::~StdMeshers_NumberOfLayers2D_i
*
* Destructor
*/
//=============================================================================
StdMeshers_NumberOfLayers2D_i::~StdMeshers_NumberOfLayers2D_i()
{
MESSAGE( "StdMeshers_NumberOfLayers2D_i::~StdMeshers_NumberOfLayers2D_i" );
}
//=============================================================================
/*!
* StdMeshers_NumberOfLayers2D_i::GetImpl
*
* Get implementation
*/
//=============================================================================
::StdMeshers_NumberOfLayers2D* StdMeshers_NumberOfLayers2D_i::GetImpl()
{
return ( ::StdMeshers_NumberOfLayers2D* )myBaseImpl;
}
//================================================================================
/*!
* \brief Verify whether hypothesis supports given entity type
* \param type - dimension (see SMESH::Dimension enumeration)
* \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise
*
* Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration)
*/
//================================================================================
CORBA::Boolean StdMeshers_NumberOfLayers2D_i::IsDimSupported( SMESH::Dimension type )
{
return type == SMESH::DIM_2D;
}

View File

@ -0,0 +1,62 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_NumberOfLayers2D_i.hxx
// Author : Edward AGAPOV
// Module : SMESH
// $Header$
//
#ifndef _SMESH_NumberOfLayers2D_I_HXX_
#define _SMESH_NumberOfLayers2D_I_HXX_
#include "StdMeshers_NumberOfLayers2D.hxx"
#include "StdMeshers_NumberOfLayers_i.hxx"
// =========================================================
/*!
* This hypothesis is used by "Radial quadrangle" algorithm.
* It specifies number of segments between the internal
* and the external surfaces.
*/
// =========================================================
class StdMeshers_NumberOfLayers2D_i:
public virtual POA_StdMeshers::StdMeshers_NumberOfLayers2D,
public virtual StdMeshers_NumberOfLayers_i
{
public:
// Constructor
StdMeshers_NumberOfLayers2D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_NumberOfLayers2D_i();
// Get implementation
::StdMeshers_NumberOfLayers2D* GetImpl();
// Verify whether hypothesis supports given entity type
CORBA::Boolean IsDimSupported( SMESH::Dimension type );
};
#endif

View File

@ -0,0 +1,71 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_RadialQuadrangle_1D2D_i.cxx
// Author : Paul RASCLE, EDF
// Module : SMESH
//
#include "StdMeshers_RadialQuadrangle_1D2D_i.hxx"
#include "SMESH_Gen.hxx"
#include "Utils_CorbaException.hxx"
#include "utilities.h"
using namespace std;
//=============================================================================
/*!
* StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i
*/
//=============================================================================
StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i
(PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl)
: SALOME::GenericObj_i( thePOA ),
SMESH_Hypothesis_i( thePOA ),
SMESH_Algo_i( thePOA ),
SMESH_2D_Algo_i( thePOA )
{
MESSAGE( "StdMeshers_RadialQuadrangle_1D2D_i::StdMeshers_RadialQuadrangle_1D2D_i" );
myBaseImpl = new ::StdMeshers_RadialQuadrangle_1D2D(theGenImpl->GetANewId(),
theStudyId,
theGenImpl );
}
//-----------------------------------------------------------------------------
StdMeshers_RadialQuadrangle_1D2D_i::~StdMeshers_RadialQuadrangle_1D2D_i()
{
MESSAGE( "StdMeshers_RadialQuadrangle_1D2D_i::~StdMeshers_RadialQuadrangle_1D2D_i" );
}
//-----------------------------------------------------------------------------
::StdMeshers_RadialQuadrangle_1D2D* StdMeshers_RadialQuadrangle_1D2D_i::GetImpl()
{
MESSAGE( "StdMeshers_RadialQuadrangle_1D2D_i::GetImpl" );
return ( ::StdMeshers_RadialQuadrangle_1D2D* )myBaseImpl;
}

View File

@ -0,0 +1,57 @@
// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
// File : StdMeshers_RadialQuadrangle_1D2D_i.hxx
// Author : Paul RASCLE, EDF
// Module : SMESH
// $Header$
//
#ifndef _SMESH_RadialQuadrangle_1D2D_I_HXX_
#define _SMESH_RadialQuadrangle_1D2D_I_HXX_
#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis)
#include "SMESH_2D_Algo_i.hxx"
#include "StdMeshers_RadialQuadrangle_1D2D.hxx"
class SMESH_Gen;
class StdMeshers_RadialQuadrangle_1D2D_i:
public virtual POA_StdMeshers::StdMeshers_RadialQuadrangle_1D2D,
public virtual SMESH_2D_Algo_i
{
public:
// Constructor
StdMeshers_RadialQuadrangle_1D2D_i( PortableServer::POA_ptr thePOA,
int theStudyId,
::SMESH_Gen* theGenImpl );
// Destructor
virtual ~StdMeshers_RadialQuadrangle_1D2D_i();
// Get implementation
::StdMeshers_RadialQuadrangle_1D2D* GetImpl();
};
#endif

View File

@ -34,6 +34,7 @@
#include "StdMeshers_AutomaticLength_i.hxx" #include "StdMeshers_AutomaticLength_i.hxx"
#include "StdMeshers_StartEndLength_i.hxx" #include "StdMeshers_StartEndLength_i.hxx"
#include "StdMeshers_Arithmetic1D_i.hxx" #include "StdMeshers_Arithmetic1D_i.hxx"
#include "StdMeshers_FixedPoints1D_i.hxx"
#include "StdMeshers_NumberOfSegments_i.hxx" #include "StdMeshers_NumberOfSegments_i.hxx"
#include "StdMeshers_Deflection1D_i.hxx" #include "StdMeshers_Deflection1D_i.hxx"
#include "StdMeshers_Propagation_i.hxx" #include "StdMeshers_Propagation_i.hxx"
@ -49,6 +50,8 @@
#include "StdMeshers_ProjectionSource1D_i.hxx" #include "StdMeshers_ProjectionSource1D_i.hxx"
#include "StdMeshers_NumberOfLayers_i.hxx" #include "StdMeshers_NumberOfLayers_i.hxx"
#include "StdMeshers_LayerDistribution_i.hxx" #include "StdMeshers_LayerDistribution_i.hxx"
#include "StdMeshers_NumberOfLayers2D_i.hxx"
#include "StdMeshers_LayerDistribution2D_i.hxx"
#include "StdMeshers_SegmentLengthAroundVertex_i.hxx" #include "StdMeshers_SegmentLengthAroundVertex_i.hxx"
#include "StdMeshers_MaxLength_i.hxx" #include "StdMeshers_MaxLength_i.hxx"
#include "StdMeshers_QuadrangleParams_i.hxx" #include "StdMeshers_QuadrangleParams_i.hxx"
@ -62,6 +65,7 @@
#include "StdMeshers_SegmentAroundVertex_0D_i.hxx" #include "StdMeshers_SegmentAroundVertex_0D_i.hxx"
#include "StdMeshers_CompositeSegment_1D_i.hxx" #include "StdMeshers_CompositeSegment_1D_i.hxx"
#include "StdMeshers_UseExisting_1D2D_i.hxx" #include "StdMeshers_UseExisting_1D2D_i.hxx"
#include "StdMeshers_RadialQuadrangle_1D2D_i.hxx"
template <class T> class StdHypothesisCreator_i:public HypothesisCreator_i<T> template <class T> class StdHypothesisCreator_i:public HypothesisCreator_i<T>
@ -106,6 +110,8 @@ STDMESHERS_I_EXPORT
aCreator = new StdHypothesisCreator_i<StdMeshers_StartEndLength_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_StartEndLength_i>;
else if (strcmp(aHypName, "Deflection1D") == 0) else if (strcmp(aHypName, "Deflection1D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_Deflection1D_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_Deflection1D_i>;
else if (strcmp(aHypName, "FixedPoints1D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_FixedPoints1D_i>;
else if (strcmp(aHypName, "Arithmetic1D") == 0) else if (strcmp(aHypName, "Arithmetic1D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_Arithmetic1D_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_Arithmetic1D_i>;
else if (strcmp(aHypName, "AutomaticLength") == 0) else if (strcmp(aHypName, "AutomaticLength") == 0)
@ -126,6 +132,10 @@ STDMESHERS_I_EXPORT
aCreator = new StdHypothesisCreator_i<StdMeshers_NumberOfLayers_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_NumberOfLayers_i>;
else if (strcmp(aHypName, "LayerDistribution") == 0) else if (strcmp(aHypName, "LayerDistribution") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_LayerDistribution_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_LayerDistribution_i>;
else if (strcmp(aHypName, "NumberOfLayers2D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_NumberOfLayers2D_i>;
else if (strcmp(aHypName, "LayerDistribution2D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_LayerDistribution2D_i>;
else if (strcmp(aHypName, "SegmentLengthAroundVertex") == 0) else if (strcmp(aHypName, "SegmentLengthAroundVertex") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_SegmentLengthAroundVertex_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_SegmentLengthAroundVertex_i>;
else if (strcmp(aHypName, "QuadrangleParams") == 0) else if (strcmp(aHypName, "QuadrangleParams") == 0)
@ -158,6 +168,8 @@ STDMESHERS_I_EXPORT
aCreator = new StdHypothesisCreator_i<StdMeshers_UseExisting_1D_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_UseExisting_1D_i>;
else if (strcmp(aHypName, "UseExisting_2D") == 0) else if (strcmp(aHypName, "UseExisting_2D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_UseExisting_2D_i>; aCreator = new StdHypothesisCreator_i<StdMeshers_UseExisting_2D_i>;
else if (strcmp(aHypName, "RadialQuadrangle_1D2D") == 0)
aCreator = new StdHypothesisCreator_i<StdMeshers_RadialQuadrangle_1D2D_i>;
else ; else ;
return aCreator; return aCreator;