mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 16:30:34 +05:00
Integration improvements 0020310 and 0020431.
This commit is contained in:
parent
874fdebf62
commit
3add66f219
BIN
doc/salome/gui/SMESH/images/hypo_fixedpnt_dlg.png
Executable file
BIN
doc/salome/gui/SMESH/images/hypo_fixedpnt_dlg.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
doc/salome/gui/SMESH/images/hypo_radquad_dlg.png
Executable file
BIN
doc/salome/gui/SMESH/images/hypo_radquad_dlg.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
BIN
doc/salome/gui/SMESH/images/mesh_fixedpnt.png
Executable file
BIN
doc/salome/gui/SMESH/images/mesh_fixedpnt.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
BIN
doc/salome/gui/SMESH/images/mesh_radquad_01.png
Executable file
BIN
doc/salome/gui/SMESH/images/mesh_radquad_01.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
doc/salome/gui/SMESH/images/mesh_radquad_02.png
Executable file
BIN
doc/salome/gui/SMESH/images/mesh_radquad_02.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@ -11,6 +11,7 @@
|
||||
<li>\ref number_of_segments_anchor "Number of segments"</li>
|
||||
<li>\ref start_and_end_length_anchor "Start and end length"</li>
|
||||
<li>\ref automatic_length_anchor "Automatic Length"</li>
|
||||
<li>\ref fixed_points_1d_anchor "Fixed points 1D"</li>
|
||||
</ul>
|
||||
|
||||
<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 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
|
||||
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ shape of a mesh.</li>
|
||||
are split into triangular elements.</li>
|
||||
<li>Quadrangle meshing algorithm (Mapping) - Faces are split into
|
||||
quadrangular elements.</li>
|
||||
<li>Radial quadrangle 1D2D algorithm - Faces (circles or part of circles)
|
||||
are split into triangular and quadrangle elements.</li>
|
||||
</ul>
|
||||
|
||||
\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 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 radial_quadrangle_1D2D_algo_page "for meshing special 2d
|
||||
faces (circles and part of circles)"</li>
|
||||
</ul>
|
||||
|
||||
\ref constructing_meshes_page "Constructing meshes" page describes in
|
||||
|
28
doc/salome/gui/SMESH/input/radial_quadrangle_1D2D_algo.doc
Normal file
28
doc/salome/gui/SMESH/input/radial_quadrangle_1D2D_algo.doc
Normal 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
|
||||
|
||||
*/
|
@ -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
|
||||
*/
|
||||
@ -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.
|
||||
* 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
|
||||
|
@ -54,6 +54,11 @@
|
||||
icon-id="mesh_hypo_length.png"
|
||||
dim="1"/>
|
||||
|
||||
<hypothesis type="FixedPoints1D"
|
||||
label-id="Fixed points 1D"
|
||||
icon-id="mesh_hypo_length.png"
|
||||
dim="1"/>
|
||||
|
||||
<hypothesis type="StartEndLength"
|
||||
label-id="Start and End Length"
|
||||
icon-id="mesh_hypo_length.png"
|
||||
@ -145,6 +150,16 @@
|
||||
icon-id="mesh_hypo_length.png"
|
||||
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"
|
||||
label-id="Quadrangle Parameters"
|
||||
icon-id="mesh_hypo_length.png"
|
||||
@ -164,7 +179,7 @@
|
||||
<algorithm type="Regular_1D"
|
||||
label-id="Wire discretisation"
|
||||
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"
|
||||
input="VERTEX"
|
||||
output="EDGE"
|
||||
@ -251,6 +266,14 @@
|
||||
output="QUAD,TRIA"
|
||||
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>
|
||||
</meshers-group>
|
||||
|
||||
|
@ -505,6 +505,8 @@ QString SMESHGUI_GenericHypothesisCreator::helpPage() const
|
||||
aHelpFileName = "a1d_meshing_hypo_page.html#max_length_anchor";
|
||||
else if ( aHypType == "Arithmetic1D")
|
||||
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")
|
||||
aHelpFileName = "a2d_meshing_hypo_page.html#max_element_area_anchor";
|
||||
else if ( aHypType == "MaxElementVolume")
|
||||
|
@ -3741,6 +3741,45 @@ class Mesh_Segment(Mesh_Algorithm):
|
||||
return True
|
||||
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
|
||||
# @param start defines the length of the first segment
|
||||
# @param end defines the length of the last segment
|
||||
@ -4804,6 +4843,104 @@ class Mesh_RadialPrism3D(Mesh_Algorithm):
|
||||
hyp.SetFineness( fineness )
|
||||
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
|
||||
# -------------------------------
|
||||
class Mesh_UseExisting(Mesh_Algorithm):
|
||||
|
@ -32,6 +32,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_LocalLength.hxx \
|
||||
StdMeshers_StartEndLength.hxx \
|
||||
StdMeshers_Arithmetic1D.hxx \
|
||||
StdMeshers_FixedPoints1D.hxx \
|
||||
StdMeshers_NumberOfSegments.hxx \
|
||||
StdMeshers_Deflection1D.hxx \
|
||||
StdMeshers_Propagation.hxx \
|
||||
@ -49,6 +50,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_QuadranglePreference.hxx \
|
||||
StdMeshers_QuadraticMesh.hxx \
|
||||
StdMeshers_NumberOfLayers.hxx \
|
||||
StdMeshers_NumberOfLayers2D.hxx \
|
||||
StdMeshers_Prism_3D.hxx \
|
||||
StdMeshers_ProjectionSource1D.hxx \
|
||||
StdMeshers_ProjectionSource2D.hxx \
|
||||
@ -59,6 +61,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_RadialPrism_3D.hxx \
|
||||
StdMeshers_ProjectionUtils.hxx \
|
||||
StdMeshers_LayerDistribution.hxx \
|
||||
StdMeshers_LayerDistribution2D.hxx \
|
||||
StdMeshers_SegmentAroundVertex_0D.hxx \
|
||||
StdMeshers_SegmentLengthAroundVertex.hxx \
|
||||
StdMeshers_FaceSide.hxx \
|
||||
@ -69,7 +72,8 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_TrianglePreference.hxx \
|
||||
StdMeshers_CompositeHexa_3D.hxx \
|
||||
StdMeshers_MaxLength.hxx \
|
||||
StdMeshers_QuadrangleParams.hxx
|
||||
StdMeshers_QuadrangleParams.hxx \
|
||||
StdMeshers_RadialQuadrangle_1D2D.hxx
|
||||
|
||||
# Libraries targets
|
||||
|
||||
@ -79,6 +83,7 @@ dist_libStdMeshers_la_SOURCES = \
|
||||
StdMeshers_LocalLength.cxx \
|
||||
StdMeshers_StartEndLength.cxx \
|
||||
StdMeshers_Arithmetic1D.cxx \
|
||||
StdMeshers_FixedPoints1D.cxx \
|
||||
StdMeshers_NumberOfSegments.cxx \
|
||||
StdMeshers_Deflection1D.cxx \
|
||||
StdMeshers_Propagation.cxx \
|
||||
@ -96,6 +101,7 @@ dist_libStdMeshers_la_SOURCES = \
|
||||
StdMeshers_QuadranglePreference.cxx \
|
||||
StdMeshers_QuadraticMesh.cxx \
|
||||
StdMeshers_NumberOfLayers.cxx \
|
||||
StdMeshers_NumberOfLayers2D.cxx \
|
||||
StdMeshers_Prism_3D.cxx \
|
||||
StdMeshers_ProjectionSource1D.cxx \
|
||||
StdMeshers_ProjectionSource2D.cxx \
|
||||
@ -106,6 +112,7 @@ dist_libStdMeshers_la_SOURCES = \
|
||||
StdMeshers_RadialPrism_3D.cxx \
|
||||
StdMeshers_ProjectionUtils.cxx \
|
||||
StdMeshers_LayerDistribution.cxx \
|
||||
StdMeshers_LayerDistribution2D.cxx \
|
||||
StdMeshers_SegmentAroundVertex_0D.cxx \
|
||||
StdMeshers_SegmentLengthAroundVertex.cxx \
|
||||
StdMeshers_FaceSide.cxx \
|
||||
@ -115,7 +122,8 @@ dist_libStdMeshers_la_SOURCES = \
|
||||
StdMeshers_TrianglePreference.cxx \
|
||||
StdMeshers_CompositeHexa_3D.cxx \
|
||||
StdMeshers_MaxLength.cxx \
|
||||
StdMeshers_QuadrangleParams.cxx
|
||||
StdMeshers_QuadrangleParams.cxx \
|
||||
StdMeshers_RadialQuadrangle_1D2D.cxx
|
||||
|
||||
|
||||
# additionnal information to compil and link file
|
||||
|
243
src/StdMeshers/StdMeshers_FixedPoints1D.cxx
Normal file
243
src/StdMeshers/StdMeshers_FixedPoints1D.cxx
Normal 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;
|
||||
}
|
||||
|
90
src/StdMeshers/StdMeshers_FixedPoints1D.hxx
Normal file
90
src/StdMeshers/StdMeshers_FixedPoints1D.hxx
Normal 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
|
61
src/StdMeshers/StdMeshers_LayerDistribution2D.cxx
Normal file
61
src/StdMeshers/StdMeshers_LayerDistribution2D.cxx
Normal 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" );
|
||||
}
|
55
src/StdMeshers/StdMeshers_LayerDistribution2D.hxx
Normal file
55
src/StdMeshers/StdMeshers_LayerDistribution2D.hxx
Normal 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
|
||||
|
63
src/StdMeshers/StdMeshers_NumberOfLayers2D.cxx
Normal file
63
src/StdMeshers/StdMeshers_NumberOfLayers2D.cxx
Normal 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" );
|
||||
}
|
||||
|
54
src/StdMeshers/StdMeshers_NumberOfLayers2D.hxx
Normal file
54
src/StdMeshers/StdMeshers_NumberOfLayers2D.hxx
Normal 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
|
||||
|
@ -91,7 +91,7 @@ StdMeshers_Penta_3D::~StdMeshers_Penta_3D()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
bool StdMeshers_Penta_3D::Compute(SMESH_Mesh& aMesh,
|
||||
const TopoDS_Shape& aShape)
|
||||
const TopoDS_Shape& aShape)
|
||||
{
|
||||
MESSAGE("StdMeshers_Penta_3D::Compute()");
|
||||
//
|
||||
@ -424,7 +424,7 @@ void StdMeshers_Penta_3D::MakeNodes()
|
||||
ShapeSupportID(bIsUpperLayer, aBNSSID, aSSID);
|
||||
if (!myErrorStatus->IsOK()) {
|
||||
MESSAGE("StdMeshers_Penta_3D::MakeNodes() ");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
//
|
||||
aTN.SetShapeSupportID(aSSID);
|
||||
@ -432,13 +432,13 @@ void StdMeshers_Penta_3D::MakeNodes()
|
||||
aTN.SetBaseNodeID(iBNID);
|
||||
//
|
||||
if (aSSID!=SMESH_Block::ID_NONE){
|
||||
// try to find the node
|
||||
const TopoDS_Shape& aS=myBlock.Shape((int)aSSID);
|
||||
FindNodeOnShape(aS, aCoords, i, aTN);
|
||||
// try to find the node
|
||||
const TopoDS_Shape& aS=myBlock.Shape((int)aSSID);
|
||||
FindNodeOnShape(aS, aCoords, i, aTN);
|
||||
}
|
||||
else{
|
||||
// create node and get it id
|
||||
CreateNode (bIsUpperLayer, aCoords, aTN);
|
||||
// create node and get it id
|
||||
CreateNode (bIsUpperLayer, aCoords, aTN);
|
||||
//
|
||||
if ( bIsUpperLayer ) {
|
||||
const SMDS_MeshNode* n = aTN.Node();
|
||||
@ -471,7 +471,7 @@ void StdMeshers_Penta_3D::MakeNodes()
|
||||
}
|
||||
if (!myErrorStatus->IsOK()) {
|
||||
MESSAGE("StdMeshers_Penta_3D::MakeNodes() ");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
//
|
||||
myTNodes[ij]=aTN;
|
||||
@ -485,20 +485,20 @@ void StdMeshers_Penta_3D::MakeNodes()
|
||||
for (i=0; i<myISize; ++i) {
|
||||
printf(" Layer# %d\n", i);
|
||||
for (j=0; j<myJSize; ++j) {
|
||||
ij=i*myJSize+j;
|
||||
const StdMeshers_TNode& aTN=myTNodes[ij];
|
||||
//const StdMeshers_TNode& aTN=aTNodes[ij];
|
||||
const gp_XYZ& aXYZ=aTN.NormCoord();
|
||||
iSSID=aTN.ShapeSupportID();
|
||||
iBNID=aTN.BaseNodeID();
|
||||
//
|
||||
const SMDS_MeshNode* aNode=aTN.Node();
|
||||
aID=aNode->GetID();
|
||||
aX=aNode->X();
|
||||
aY=aNode->Y();
|
||||
aZ=aNode->Z();
|
||||
printf("*** j:%d BNID#%d iSSID:%d ID:%d { %lf %lf %lf }, { %lf %lf %lf }\n",
|
||||
j, iBNID, iSSID, aID, aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aX, aY, aZ);
|
||||
ij=i*myJSize+j;
|
||||
const StdMeshers_TNode& aTN=myTNodes[ij];
|
||||
//const StdMeshers_TNode& aTN=aTNodes[ij];
|
||||
const gp_XYZ& aXYZ=aTN.NormCoord();
|
||||
iSSID=aTN.ShapeSupportID();
|
||||
iBNID=aTN.BaseNodeID();
|
||||
//
|
||||
const SMDS_MeshNode* aNode=aTN.Node();
|
||||
aID=aNode->GetID();
|
||||
aX=aNode->X();
|
||||
aY=aNode->Y();
|
||||
aZ=aNode->Z();
|
||||
printf("*** j:%d BNID#%d iSSID:%d ID:%d { %lf %lf %lf }, { %lf %lf %lf }\n",
|
||||
j, iBNID, iSSID, aID, aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aX, aY, aZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -513,9 +513,9 @@ void StdMeshers_Penta_3D::MakeNodes()
|
||||
//=======================================================================
|
||||
|
||||
void StdMeshers_Penta_3D::FindNodeOnShape(const TopoDS_Shape& aS,
|
||||
const gp_XYZ& aParams,
|
||||
const gp_XYZ& aParams,
|
||||
const int z,
|
||||
StdMeshers_TNode& aTN)
|
||||
StdMeshers_TNode& aTN)
|
||||
{
|
||||
double aX, aY, aZ, aD, aTol2, minD;
|
||||
gp_Pnt aP1, aP2;
|
||||
@ -675,8 +675,8 @@ void StdMeshers_Penta_3D::MakeVolumeMesh()
|
||||
const StdMeshers_TNode& aTN = myTNodes[ij];
|
||||
aSSID=aTN.ShapeSupportID();
|
||||
if (aSSID==SMESH_Block::ID_NONE) {
|
||||
SMDS_MeshNode* aNode = (SMDS_MeshNode*)aTN.Node();
|
||||
meshDS->SetNodeInVolume(aNode, shapeID);
|
||||
SMDS_MeshNode* aNode = (SMDS_MeshNode*)aTN.Node();
|
||||
meshDS->SetNodeInVolume(aNode, shapeID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -714,7 +714,7 @@ void StdMeshers_Penta_3D::MakeVolumeMesh()
|
||||
aJ[k] = GetIndexOnLayer(aID0);
|
||||
if (!myErrorStatus->IsOK()) {
|
||||
MESSAGE("StdMeshers_Penta_3D::MakeVolumeMesh");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
//
|
||||
++k;
|
||||
@ -725,15 +725,15 @@ void StdMeshers_Penta_3D::MakeVolumeMesh()
|
||||
i1=i;
|
||||
i2=i+1;
|
||||
for(j=0; j<nbFaceNodes; ++j) {
|
||||
ij = i1*myJSize+aJ[j];
|
||||
const StdMeshers_TNode& aTN1 = myTNodes[ij];
|
||||
const SMDS_MeshNode* aN1 = aTN1.Node();
|
||||
aN[j]=aN1;
|
||||
//
|
||||
ij=i2*myJSize+aJ[j];
|
||||
const StdMeshers_TNode& aTN2 = myTNodes[ij];
|
||||
const SMDS_MeshNode* aN2 = aTN2.Node();
|
||||
aN[j+nbFaceNodes] = aN2;
|
||||
ij = i1*myJSize+aJ[j];
|
||||
const StdMeshers_TNode& aTN1 = myTNodes[ij];
|
||||
const SMDS_MeshNode* aN1 = aTN1.Node();
|
||||
aN[j]=aN1;
|
||||
//
|
||||
ij=i2*myJSize+aJ[j];
|
||||
const StdMeshers_TNode& aTN2 = myTNodes[ij];
|
||||
const SMDS_MeshNode* aN2 = aTN2.Node();
|
||||
aN[j+nbFaceNodes] = aN2;
|
||||
}
|
||||
// check if volume orientation will be ok
|
||||
if ( i == 0 ) {
|
||||
@ -851,7 +851,7 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1()
|
||||
aJ = GetIndexOnLayer(aID0);
|
||||
if (!myErrorStatus->IsOK()) {
|
||||
MESSAGE("StdMeshers_Penta_3D::MakeMeshOnFxy1() ");
|
||||
return;
|
||||
return;
|
||||
}
|
||||
//
|
||||
ij = aLevel*myJSize + aJ;
|
||||
@ -939,8 +939,8 @@ void StdMeshers_Penta_3D::MakeConnectingMap()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdMeshers_Penta_3D::CreateNode(const bool bIsUpperLayer,
|
||||
const gp_XYZ& aParams,
|
||||
StdMeshers_TNode& aTN)
|
||||
const gp_XYZ& aParams,
|
||||
StdMeshers_TNode& aTN)
|
||||
{
|
||||
double aX, aY, aZ;
|
||||
//
|
||||
@ -996,8 +996,8 @@ void StdMeshers_Penta_3D::CreateNode(const bool bIsUpperLayer,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdMeshers_Penta_3D::ShapeSupportID(const bool bIsUpperLayer,
|
||||
const SMESH_Block::TShapeID aBNSSID,
|
||||
SMESH_Block::TShapeID& aSSID)
|
||||
const SMESH_Block::TShapeID aBNSSID,
|
||||
SMESH_Block::TShapeID& aSSID)
|
||||
{
|
||||
switch (aBNSSID) {
|
||||
case SMESH_Block::ID_V000:
|
||||
@ -1068,25 +1068,25 @@ void StdMeshers_Penta_3D::MakeBlock()
|
||||
const SMDS_MeshElement * pElement = itf->next();
|
||||
aElementType = pElement->GetType();
|
||||
if (aElementType==SMDSAbs_Face) {
|
||||
iNbNodes = pElement->NbNodes();
|
||||
if ( iNbNodes==3 || (pElement->IsQuadratic() && iNbNodes==6) ) {
|
||||
aFTr = aF;
|
||||
++iCnt;
|
||||
if (iCnt>1) {
|
||||
// \begin{E.A.}
|
||||
// The current algorithm fails if there is more that one
|
||||
// face wich contains triangles ...
|
||||
// In that case, replace return by break to try another
|
||||
// method (coded in "if (iCnt != 1) { ... }")
|
||||
//
|
||||
iNbNodes = pElement->NbNodes();
|
||||
if ( iNbNodes==3 || (pElement->IsQuadratic() && iNbNodes==6) ) {
|
||||
aFTr = aF;
|
||||
++iCnt;
|
||||
if (iCnt>1) {
|
||||
// \begin{E.A.}
|
||||
// The current algorithm fails if there is more that one
|
||||
// face wich contains triangles ...
|
||||
// In that case, replace return by break to try another
|
||||
// method (coded in "if (iCnt != 1) { ... }")
|
||||
//
|
||||
// MESSAGE("StdMeshers_Penta_3D::MakeBlock() ");
|
||||
// myErrorStatus=5; // more than one face has triangulation
|
||||
// return;
|
||||
break;
|
||||
// \end{E.A.}
|
||||
}
|
||||
break; // next face
|
||||
}
|
||||
// myErrorStatus=5; // more than one face has triangulation
|
||||
// return;
|
||||
break;
|
||||
// \end{E.A.}
|
||||
}
|
||||
break; // next face
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1155,85 +1155,85 @@ void StdMeshers_Penta_3D::MakeBlock()
|
||||
int has_only_quad_f6 = 1;
|
||||
//
|
||||
for (i=1; i<=iNbF; ++i) {
|
||||
int ok = 1;
|
||||
const TopoDS_Shape& aF = aM(i);
|
||||
SMESH_subMesh *aSubMesh = pMesh->GetSubMeshContaining(aF);
|
||||
SMESHDS_SubMesh *aSM = aSubMesh->GetSubMeshDS();
|
||||
SMDS_ElemIteratorPtr itf = aSM->GetElements();
|
||||
while(itf->more()) {
|
||||
const SMDS_MeshElement * pElement = itf->next();
|
||||
aElementType = pElement->GetType();
|
||||
if (aElementType==SMDSAbs_Face) {
|
||||
iNbNodes = pElement->NbNodes();
|
||||
if ( iNbNodes!=4 ) {
|
||||
ok = 0;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i==1) has_only_quad_f1 = ok ;
|
||||
if (i==2) has_only_quad_f2 = ok ;
|
||||
if (i==3) has_only_quad_f3 = ok ;
|
||||
if (i==4) has_only_quad_f4 = ok ;
|
||||
if (i==5) has_only_quad_f5 = ok ;
|
||||
if (i==6) has_only_quad_f6 = ok ;
|
||||
int ok = 1;
|
||||
const TopoDS_Shape& aF = aM(i);
|
||||
SMESH_subMesh *aSubMesh = pMesh->GetSubMeshContaining(aF);
|
||||
SMESHDS_SubMesh *aSM = aSubMesh->GetSubMeshDS();
|
||||
SMDS_ElemIteratorPtr itf = aSM->GetElements();
|
||||
while(itf->more()) {
|
||||
const SMDS_MeshElement * pElement = itf->next();
|
||||
aElementType = pElement->GetType();
|
||||
if (aElementType==SMDSAbs_Face) {
|
||||
iNbNodes = pElement->NbNodes();
|
||||
if ( iNbNodes!=4 ) {
|
||||
ok = 0;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i==1) has_only_quad_f1 = ok ;
|
||||
if (i==2) has_only_quad_f2 = ok ;
|
||||
if (i==3) has_only_quad_f3 = ok ;
|
||||
if (i==4) has_only_quad_f4 = ok ;
|
||||
if (i==5) has_only_quad_f5 = ok ;
|
||||
if (i==6) has_only_quad_f6 = ok ;
|
||||
}
|
||||
//
|
||||
TopTools_IndexedMapOfShape aE;
|
||||
TopExp::MapShapes(myShape, TopAbs_EDGE, aE);
|
||||
int iNbE = aE.Extent();
|
||||
if (iNbE == 12) {
|
||||
//
|
||||
int nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements();
|
||||
int nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements();
|
||||
int nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements();
|
||||
int nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements();
|
||||
int nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements();
|
||||
int nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements();
|
||||
int nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements();
|
||||
int nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements();
|
||||
int nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements();
|
||||
int nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements();
|
||||
int nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements();
|
||||
int nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements();
|
||||
//
|
||||
int nb_ok = 0 ;
|
||||
//
|
||||
if ( (nb_e01==nb_e03) && (nb_e03==nb_e05) && (nb_e05==nb_e07) ) {
|
||||
if ( has_only_quad_f1 && has_only_quad_f2 && has_only_quad_f3 && has_only_quad_f4 ) {
|
||||
if ( (nb_e09==nb_e10) && (nb_e08==nb_e06) && (nb_e11==nb_e12) && (nb_e04==nb_e02) ) {
|
||||
if (nb_f5==nb_f6) {
|
||||
nb_ok += 1;
|
||||
aFTr = aM(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( (nb_e02==nb_e04) && (nb_e04==nb_e06) && (nb_e06==nb_e08) ) {
|
||||
if ( has_only_quad_f1 && has_only_quad_f2 && has_only_quad_f5 && has_only_quad_f6 ) {
|
||||
if ( (nb_e01==nb_e03) && (nb_e10==nb_e12) && (nb_e05==nb_e07) && (nb_e09==nb_e11) ) {
|
||||
if (nb_f3==nb_f4) {
|
||||
nb_ok += 1;
|
||||
aFTr = aM(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( (nb_e09==nb_e10) && (nb_e10==nb_e11) && (nb_e11==nb_e12) ) {
|
||||
if ( has_only_quad_f3 && has_only_quad_f4 && has_only_quad_f5 && has_only_quad_f6 ) {
|
||||
if ( (nb_e01==nb_e05) && (nb_e02==nb_e06) && (nb_e03==nb_e07) && (nb_e04==nb_e08) ) {
|
||||
if (nb_f1==nb_f2) {
|
||||
nb_ok += 1;
|
||||
aFTr = aM(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
if ( nb_ok == 1 ) {
|
||||
isOK = 1;
|
||||
}
|
||||
//
|
||||
//
|
||||
int nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements();
|
||||
int nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements();
|
||||
int nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements();
|
||||
int nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements();
|
||||
int nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements();
|
||||
int nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements();
|
||||
int nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements();
|
||||
int nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements();
|
||||
int nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements();
|
||||
int nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements();
|
||||
int nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements();
|
||||
int nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements();
|
||||
//
|
||||
int nb_ok = 0 ;
|
||||
//
|
||||
if ( (nb_e01==nb_e03) && (nb_e03==nb_e05) && (nb_e05==nb_e07) ) {
|
||||
if ( has_only_quad_f1 && has_only_quad_f2 && has_only_quad_f3 && has_only_quad_f4 ) {
|
||||
if ( (nb_e09==nb_e10) && (nb_e08==nb_e06) && (nb_e11==nb_e12) && (nb_e04==nb_e02) ) {
|
||||
if (nb_f5==nb_f6) {
|
||||
nb_ok += 1;
|
||||
aFTr = aM(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( (nb_e02==nb_e04) && (nb_e04==nb_e06) && (nb_e06==nb_e08) ) {
|
||||
if ( has_only_quad_f1 && has_only_quad_f2 && has_only_quad_f5 && has_only_quad_f6 ) {
|
||||
if ( (nb_e01==nb_e03) && (nb_e10==nb_e12) && (nb_e05==nb_e07) && (nb_e09==nb_e11) ) {
|
||||
if (nb_f3==nb_f4) {
|
||||
nb_ok += 1;
|
||||
aFTr = aM(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( (nb_e09==nb_e10) && (nb_e10==nb_e11) && (nb_e11==nb_e12) ) {
|
||||
if ( has_only_quad_f3 && has_only_quad_f4 && has_only_quad_f5 && has_only_quad_f6 ) {
|
||||
if ( (nb_e01==nb_e05) && (nb_e02==nb_e06) && (nb_e03==nb_e07) && (nb_e04==nb_e08) ) {
|
||||
if (nb_f1==nb_f2) {
|
||||
nb_ok += 1;
|
||||
aFTr = aM(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
if ( nb_ok == 1 ) {
|
||||
isOK = 1;
|
||||
}
|
||||
//
|
||||
}
|
||||
}
|
||||
if (!isOK) {
|
||||
@ -1286,11 +1286,11 @@ void StdMeshers_Penta_3D::MakeBlock()
|
||||
const TopoDS_Edge& aE=TopoDS::Edge(aEx);
|
||||
TopExp::Vertices(aE, aV[0], aV[1]);
|
||||
for (i=0; i<2; ++i) {
|
||||
if (!aV[i].IsSame(aV000)) {
|
||||
aV001=aV[i];
|
||||
bFound=!bFound;
|
||||
break;
|
||||
}
|
||||
if (!aV[i].IsSame(aV000)) {
|
||||
aV001=aV[i];
|
||||
bFound=!bFound;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1703,8 +1703,8 @@ void StdMeshers_SMESHBlock::Load(const TopoDS_Shell& theShell)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdMeshers_SMESHBlock::Load(const TopoDS_Shell& theShell,
|
||||
const TopoDS_Vertex& theV000,
|
||||
const TopoDS_Vertex& theV001)
|
||||
const TopoDS_Vertex& theV000,
|
||||
const TopoDS_Vertex& theV001)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@ -1725,7 +1725,7 @@ void StdMeshers_SMESHBlock::Load(const TopoDS_Shell& theShell,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdMeshers_SMESHBlock::ComputeParameters(const gp_Pnt& thePnt,
|
||||
gp_XYZ& theXYZ)
|
||||
gp_XYZ& theXYZ)
|
||||
{
|
||||
ComputeParameters(thePnt, myShell, theXYZ);
|
||||
}
|
||||
@ -1735,7 +1735,7 @@ void StdMeshers_SMESHBlock::ComputeParameters(const gp_Pnt& thePnt,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdMeshers_SMESHBlock::ComputeParameters(const gp_Pnt& thePnt,
|
||||
const TopoDS_Shape& theShape,
|
||||
const TopoDS_Shape& theShape,
|
||||
gp_XYZ& theXYZ)
|
||||
{
|
||||
myErrorStatus=0;
|
||||
@ -1785,7 +1785,7 @@ void StdMeshers_SMESHBlock::ComputeParameters(const double& theU,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdMeshers_SMESHBlock::Point(const gp_XYZ& theParams,
|
||||
gp_Pnt& aP3D)
|
||||
gp_Pnt& aP3D)
|
||||
{
|
||||
TopoDS_Shape aS;
|
||||
//
|
||||
@ -1797,8 +1797,8 @@ void StdMeshers_SMESHBlock::ComputeParameters(const double& theU,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void StdMeshers_SMESHBlock::Point(const gp_XYZ& theParams,
|
||||
const TopoDS_Shape& theShape,
|
||||
gp_Pnt& aP3D)
|
||||
const TopoDS_Shape& theShape,
|
||||
gp_Pnt& aP3D)
|
||||
{
|
||||
myErrorStatus = 0;
|
||||
//
|
||||
@ -1889,8 +1889,8 @@ const TopoDS_Shape& StdMeshers_SMESHBlock::Shape(const int theID)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh,
|
||||
const TopoDS_Shape& aShape,
|
||||
MapShapeNbElems& aResMap)
|
||||
const TopoDS_Shape& aShape,
|
||||
MapShapeNbElems& aResMap)
|
||||
{
|
||||
MESSAGE("StdMeshers_Penta_3D::Evaluate()");
|
||||
|
||||
@ -1904,6 +1904,10 @@ bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh,
|
||||
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
|
||||
meshFaces.push_back(aSubMesh);
|
||||
MapShapeNbElemsItr anIt = aResMap.find(meshFaces[i]);
|
||||
if( anIt == aResMap.end() ) {
|
||||
NumBase = 0;
|
||||
break;
|
||||
}
|
||||
std::vector<int> aVec = (*anIt).second;
|
||||
int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
|
||||
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
|
||||
int nb1d = 0;
|
||||
@ -1934,8 +1946,8 @@ bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh,
|
||||
bool IsOpposite = true;
|
||||
for(TopExp_Explorer exp(aFaces.Value(i), TopAbs_EDGE); exp.More(); exp.Next()) {
|
||||
if( Edges1.Contains(exp.Current()) ) {
|
||||
IsOpposite = false;
|
||||
break;
|
||||
IsOpposite = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(IsOpposite) {
|
||||
|
1088
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
Normal file
1088
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx
Normal file
File diff suppressed because it is too large
Load Diff
69
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx
Normal file
69
src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.hxx
Normal 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
|
@ -73,22 +73,24 @@ using namespace std;
|
||||
//=============================================================================
|
||||
|
||||
StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId, int studyId,
|
||||
SMESH_Gen * gen):SMESH_1D_Algo(hypId, studyId, gen)
|
||||
SMESH_Gen * gen):SMESH_1D_Algo(hypId, studyId, gen)
|
||||
{
|
||||
MESSAGE("StdMeshers_Regular_1D::StdMeshers_Regular_1D");
|
||||
_name = "Regular_1D";
|
||||
_shapeType = (1 << TopAbs_EDGE);
|
||||
MESSAGE("StdMeshers_Regular_1D::StdMeshers_Regular_1D");
|
||||
_name = "Regular_1D";
|
||||
_shapeType = (1 << TopAbs_EDGE);
|
||||
_fpHyp = 0;
|
||||
|
||||
_compatibleHypothesis.push_back("LocalLength");
|
||||
_compatibleHypothesis.push_back("MaxLength");
|
||||
_compatibleHypothesis.push_back("NumberOfSegments");
|
||||
_compatibleHypothesis.push_back("StartEndLength");
|
||||
_compatibleHypothesis.push_back("Deflection1D");
|
||||
_compatibleHypothesis.push_back("Arithmetic1D");
|
||||
_compatibleHypothesis.push_back("AutomaticLength");
|
||||
_compatibleHypothesis.push_back("LocalLength");
|
||||
_compatibleHypothesis.push_back("MaxLength");
|
||||
_compatibleHypothesis.push_back("NumberOfSegments");
|
||||
_compatibleHypothesis.push_back("StartEndLength");
|
||||
_compatibleHypothesis.push_back("Deflection1D");
|
||||
_compatibleHypothesis.push_back("Arithmetic1D");
|
||||
_compatibleHypothesis.push_back("FixedPoints1D");
|
||||
_compatibleHypothesis.push_back("AutomaticLength");
|
||||
|
||||
_compatibleHypothesis.push_back("QuadraticMesh"); // auxiliary !!!
|
||||
_compatibleHypothesis.push_back("Propagation"); // auxiliary !!!
|
||||
_compatibleHypothesis.push_back("QuadraticMesh"); // auxiliary !!!
|
||||
_compatibleHypothesis.push_back("Propagation"); // auxiliary !!!
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@ -218,6 +220,16 @@ bool StdMeshers_Regular_1D::CheckHypothesis
|
||||
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")
|
||||
{
|
||||
const StdMeshers_StartEndLength * hyp =
|
||||
@ -773,6 +785,62 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh,
|
||||
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: {
|
||||
|
||||
GCPnts_UniformDeflection Discret(theC3d, _value[ DEFLECTION_IND ], f, l, true);
|
||||
@ -828,14 +896,18 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t
|
||||
{
|
||||
list< double > params;
|
||||
bool reversed = false;
|
||||
if ( theMesh.GetShapeToMesh().ShapeType() >= TopAbs_WIRE )
|
||||
if ( theMesh.GetShapeToMesh().ShapeType() >= TopAbs_WIRE ) {
|
||||
reversed = ( EE.Orientation() == TopAbs_REVERSED );
|
||||
if ( !_mainEdge.IsNull() )
|
||||
}
|
||||
if ( !_mainEdge.IsNull() ) {
|
||||
reversed = ( _mainEdge.Orientation() == TopAbs_REVERSED );
|
||||
}
|
||||
else if ( _revEdgesIDs.size() > 0 ) {
|
||||
for ( int i = 0; i < _revEdgesIDs.size(); i++)
|
||||
if ( _revEdgesIDs[i] == shapeID )
|
||||
reversed = !reversed;
|
||||
for ( int i = 0; i < _revEdgesIDs.size(); i++) {
|
||||
if ( _revEdgesIDs[i] == shapeID ) {
|
||||
reversed = !reversed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BRepAdaptor_Curve C3d( E );
|
||||
@ -954,8 +1026,8 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t
|
||||
//=============================================================================
|
||||
|
||||
bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh,
|
||||
const TopoDS_Shape & theShape,
|
||||
MapShapeNbElems& aResMap)
|
||||
const TopoDS_Shape & theShape,
|
||||
MapShapeNbElems& aResMap)
|
||||
{
|
||||
if ( _hypType == NONE )
|
||||
return false;
|
||||
|
@ -32,6 +32,8 @@
|
||||
|
||||
#include "SMESH_1D_Algo.hxx"
|
||||
|
||||
#include "StdMeshers_FixedPoints1D.hxx"
|
||||
|
||||
class Adaptor3d_Curve;
|
||||
class TopoDS_Vertex;
|
||||
class StdMeshers_SegmentLengthAroundVertex;
|
||||
@ -97,7 +99,7 @@ protected:
|
||||
StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh,
|
||||
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 {
|
||||
SCALE_FACTOR_IND = 0,
|
||||
@ -123,6 +125,8 @@ protected:
|
||||
|
||||
HypothesisType _hypType;
|
||||
|
||||
const StdMeshers_FixedPoints1D* _fpHyp;
|
||||
|
||||
double _value[2];
|
||||
int _ivalue[3];
|
||||
std::vector<double> _vvalue[1];
|
||||
|
@ -36,7 +36,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshersGUI_NbSegmentsCreator.h \
|
||||
StdMeshersGUI_ObjectReferenceParamWdg.h \
|
||||
StdMeshersGUI_LayerDistributionParamWdg.h \
|
||||
StdMeshersGUI_EdgeDirectionParamWdg.h \
|
||||
StdMeshersGUI_FixedPointsParamWdg.h \
|
||||
StdMeshersGUI_SubShapeSelectorWdg.h
|
||||
|
||||
# Libraries targets
|
||||
@ -49,7 +49,7 @@ dist_libStdMeshersGUI_la_SOURCES = \
|
||||
StdMeshersGUI_NbSegmentsCreator.cxx \
|
||||
StdMeshersGUI_ObjectReferenceParamWdg.cxx \
|
||||
StdMeshersGUI_LayerDistributionParamWdg.cxx \
|
||||
StdMeshersGUI_EdgeDirectionParamWdg.cxx \
|
||||
StdMeshersGUI_FixedPointsParamWdg.cxx \
|
||||
StdMeshersGUI_SubShapeSelectorWdg.cxx
|
||||
|
||||
MOC_FILES = \
|
||||
@ -59,7 +59,7 @@ MOC_FILES = \
|
||||
StdMeshersGUI_NbSegmentsCreator_moc.cxx \
|
||||
StdMeshersGUI_ObjectReferenceParamWdg_moc.cxx \
|
||||
StdMeshersGUI_LayerDistributionParamWdg_moc.cxx \
|
||||
StdMeshersGUI_EdgeDirectionParamWdg_moc.cxx \
|
||||
StdMeshersGUI_FixedPointsParamWdg_moc.cxx \
|
||||
StdMeshersGUI_SubShapeSelectorWdg_moc.cxx
|
||||
|
||||
nodist_libStdMeshersGUI_la_SOURCES= \
|
||||
|
374
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx
Normal file
374
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx
Normal 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]);
|
||||
}
|
||||
}
|
93
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h
Normal file
93
src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h
Normal 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
|
@ -33,8 +33,8 @@
|
||||
#include <SMESH_NumberFilter.hxx>
|
||||
#include "StdMeshersGUI_ObjectReferenceParamWdg.h"
|
||||
#include "StdMeshersGUI_LayerDistributionParamWdg.h"
|
||||
//#include "StdMeshersGUI_EdgeDirectionParamWdg.h"
|
||||
#include "StdMeshersGUI_SubShapeSelectorWdg.h"
|
||||
#include "StdMeshersGUI_FixedPointsParamWdg.h"
|
||||
#include <SALOMEDSClient_Study.hxx>
|
||||
|
||||
// SALOME GUI includes
|
||||
@ -200,9 +200,9 @@ namespace {
|
||||
QHBoxLayout* aHBoxL = new QHBoxLayout(this);
|
||||
|
||||
if ( !leftLabel.isEmpty() ) {
|
||||
QLabel* aLeftLabel = new QLabel( this );
|
||||
aLeftLabel->setText( leftLabel );
|
||||
aHBoxL->addWidget( aLeftLabel );
|
||||
QLabel* aLeftLabel = new QLabel( this );
|
||||
aLeftLabel->setText( leftLabel );
|
||||
aHBoxL->addWidget( aLeftLabel );
|
||||
}
|
||||
|
||||
_slider = new QSlider( Qt::Horizontal, this );
|
||||
@ -211,9 +211,9 @@ namespace {
|
||||
aHBoxL->addWidget( _slider );
|
||||
|
||||
if ( !rightLabel.isEmpty() ) {
|
||||
QLabel* aRightLabel = new QLabel( this );
|
||||
aRightLabel->setText( rightLabel );
|
||||
aHBoxL->addWidget( aRightLabel );
|
||||
QLabel* aRightLabel = new QLabel( this );
|
||||
aRightLabel->setText( rightLabel );
|
||||
aHBoxL->addWidget( aRightLabel );
|
||||
}
|
||||
|
||||
setLayout( aHBoxL );
|
||||
@ -378,7 +378,7 @@ bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
|
||||
if ( ok )
|
||||
deactivateObjRefParamWdg( customWidgets() );
|
||||
}
|
||||
else if ( hypType() == "LayerDistribution" )
|
||||
else if ( hypType() == "LayerDistribution" || hypType() == "LayerDistribution2D" )
|
||||
{
|
||||
StdMeshersGUI_LayerDistributionParamWdg* w =
|
||||
widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
|
||||
@ -412,7 +412,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
if( hypType()=="LocalLength" )
|
||||
{
|
||||
StdMeshers::StdMeshers_LocalLength_var h =
|
||||
StdMeshers::StdMeshers_LocalLength::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_LocalLength::_narrow( hypothesis() );
|
||||
|
||||
h->SetLength( params[0].myValue.toDouble() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
@ -422,7 +422,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="MaxLength" )
|
||||
{
|
||||
StdMeshers::StdMeshers_MaxLength_var h =
|
||||
StdMeshers::StdMeshers_MaxLength::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_MaxLength::_narrow( hypothesis() );
|
||||
|
||||
h->SetLength( params[0].myValue.toDouble() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
@ -436,7 +436,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="SegmentLengthAroundVertex" )
|
||||
{
|
||||
StdMeshers::StdMeshers_SegmentLengthAroundVertex_var h =
|
||||
StdMeshers::StdMeshers_SegmentLengthAroundVertex::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_SegmentLengthAroundVertex::_narrow( hypothesis() );
|
||||
|
||||
h->SetLength( params[0].myValue.toDouble() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
@ -444,10 +444,8 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="Arithmetic1D" )
|
||||
{
|
||||
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 =
|
||||
widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
|
||||
|
||||
@ -456,22 +454,44 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
h->SetEndLength( params[1].myValue.toDouble() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
if (w) {
|
||||
h->SetReversedEdges( w->GetListOfIDs() );
|
||||
const char * entry = w->GetMainShapeEntry();
|
||||
h->SetObjectEntry( entry );
|
||||
h->SetReversedEdges( w->GetListOfIDs() );
|
||||
const char * entry = w->GetMainShapeEntry();
|
||||
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" )
|
||||
{
|
||||
StdMeshers::StdMeshers_MaxElementArea_var h =
|
||||
StdMeshers::StdMeshers_MaxElementArea::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_MaxElementArea::_narrow( hypothesis() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
h->SetMaxElementArea( params[0].myValue.toDouble() );
|
||||
}
|
||||
else if( hypType()=="MaxElementVolume" )
|
||||
{
|
||||
StdMeshers::StdMeshers_MaxElementVolume_var h =
|
||||
StdMeshers::StdMeshers_MaxElementVolume::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_MaxElementVolume::_narrow( hypothesis() );
|
||||
|
||||
h->SetMaxElementVolume( params[0].myValue.toDouble() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
@ -479,7 +499,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="StartEndLength" )
|
||||
{
|
||||
StdMeshers::StdMeshers_StartEndLength_var h =
|
||||
StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_StartEndLength::_narrow( hypothesis() );
|
||||
|
||||
StdMeshersGUI_SubShapeSelectorWdg* w =
|
||||
widget< StdMeshersGUI_SubShapeSelectorWdg >( 2 );
|
||||
@ -489,28 +509,28 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
h->SetEndLength( params[1].myValue.toDouble() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
if (w) {
|
||||
h->SetReversedEdges( w->GetListOfIDs() );
|
||||
h->SetObjectEntry( w->GetMainShapeEntry() );
|
||||
h->SetReversedEdges( w->GetListOfIDs() );
|
||||
h->SetObjectEntry( w->GetMainShapeEntry() );
|
||||
}
|
||||
}
|
||||
else if( hypType()=="Deflection1D" )
|
||||
{
|
||||
StdMeshers::StdMeshers_Deflection1D_var h =
|
||||
StdMeshers::StdMeshers_Deflection1D::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_Deflection1D::_narrow( hypothesis() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
h->SetDeflection( params[0].myValue.toDouble() );
|
||||
}
|
||||
else if( hypType()=="AutomaticLength" )
|
||||
{
|
||||
StdMeshers::StdMeshers_AutomaticLength_var h =
|
||||
StdMeshers::StdMeshers_AutomaticLength::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_AutomaticLength::_narrow( hypothesis() );
|
||||
|
||||
h->SetFineness( params[0].myValue.toDouble() );
|
||||
}
|
||||
else if( hypType()=="NumberOfLayers" )
|
||||
{
|
||||
StdMeshers::StdMeshers_NumberOfLayers_var h =
|
||||
StdMeshers::StdMeshers_NumberOfLayers::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_NumberOfLayers::_narrow( hypothesis() );
|
||||
|
||||
h->SetNumberOfLayers( params[0].myValue.toInt() );
|
||||
h->SetParameters(SMESHGUI::JoinObjectParameters(aVariablesList));
|
||||
@ -518,7 +538,26 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="LayerDistribution" )
|
||||
{
|
||||
StdMeshers::StdMeshers_LayerDistribution_var h =
|
||||
StdMeshers::StdMeshers_LayerDistribution::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_LayerDistribution::_narrow( hypothesis() );
|
||||
StdMeshersGUI_LayerDistributionParamWdg* w =
|
||||
widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 );
|
||||
|
||||
h->SetLayerDistribution( w->GetHypothesis() );
|
||||
h->SetParameters(w->GetHypothesis()->GetParameters());
|
||||
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 );
|
||||
|
||||
@ -529,7 +568,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="ProjectionSource1D" )
|
||||
{
|
||||
StdMeshers::StdMeshers_ProjectionSource1D_var h =
|
||||
StdMeshers::StdMeshers_ProjectionSource1D::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_ProjectionSource1D::_narrow( hypothesis() );
|
||||
|
||||
h->SetSourceEdge ( geomFromWdg ( getWidgetForParam( 0 )));
|
||||
h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 )));
|
||||
@ -539,7 +578,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="ProjectionSource2D" )
|
||||
{
|
||||
StdMeshers::StdMeshers_ProjectionSource2D_var h =
|
||||
StdMeshers::StdMeshers_ProjectionSource2D::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_ProjectionSource2D::_narrow( hypothesis() );
|
||||
|
||||
h->SetSourceFace ( geomFromWdg ( getWidgetForParam( 0 )));
|
||||
h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 )));
|
||||
@ -551,7 +590,7 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="ProjectionSource3D" )
|
||||
{
|
||||
StdMeshers::StdMeshers_ProjectionSource3D_var h =
|
||||
StdMeshers::StdMeshers_ProjectionSource3D::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_ProjectionSource3D::_narrow( hypothesis() );
|
||||
|
||||
h->SetSource3DShape ( geomFromWdg ( getWidgetForParam( 0 )));
|
||||
h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 )));
|
||||
@ -563,15 +602,15 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const
|
||||
else if( hypType()=="QuadrangleParams" )
|
||||
{
|
||||
StdMeshers::StdMeshers_QuadrangleParams_var h =
|
||||
StdMeshers::StdMeshers_QuadrangleParams::_narrow( hypothesis() );
|
||||
StdMeshers::StdMeshers_QuadrangleParams::_narrow( hypothesis() );
|
||||
StdMeshersGUI_SubShapeSelectorWdg* w =
|
||||
widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 );
|
||||
if (w) {
|
||||
if( w->GetListOfIDs()->length()>0 ) {
|
||||
h->SetTriaVertex( w->GetListOfIDs()[0] );
|
||||
}
|
||||
const char * entry = w->GetMainShapeEntry();
|
||||
h->SetObjectEntry( entry );
|
||||
if( w->GetListOfIDs()->length()>0 ) {
|
||||
h->SetTriaVertex( w->GetListOfIDs()[0] );
|
||||
}
|
||||
const char * entry = w->GetMainShapeEntry();
|
||||
h->SetObjectEntry( entry );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -692,11 +731,9 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
||||
|
||||
customWidgets()->append (0);
|
||||
|
||||
item.myName = tr( "SMESH_REVERCE_EDGES" );
|
||||
item.myName = tr( "SMESH_REVERSED_EDGES" );
|
||||
p.append( item );
|
||||
|
||||
//StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget =
|
||||
// new StdMeshersGUI_EdgeDirectionParamWdg();
|
||||
StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
|
||||
new StdMeshersGUI_SubShapeSelectorWdg();
|
||||
QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
|
||||
@ -707,6 +744,40 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
||||
aDirectionWidget->showPreview( true );
|
||||
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" )
|
||||
{
|
||||
StdMeshers::StdMeshers_MaxElementArea_var h =
|
||||
@ -746,11 +817,9 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
||||
p.append( item );
|
||||
customWidgets()->append(0);
|
||||
|
||||
item.myName = tr( "SMESH_REVERCE_EDGES" );
|
||||
item.myName = tr( "SMESH_REVERSED_EDGES" );
|
||||
p.append( item );
|
||||
|
||||
//StdMeshersGUI_EdgeDirectionParamWdg* aDirectionWidget =
|
||||
// new StdMeshersGUI_EdgeDirectionParamWdg();
|
||||
StdMeshersGUI_SubShapeSelectorWdg* aDirectionWidget =
|
||||
new StdMeshersGUI_SubShapeSelectorWdg();
|
||||
QString anEntry = SMESHGUI_GenericHypothesisCreator::getShapeEntry();
|
||||
@ -793,9 +862,8 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
||||
item.myValue = (int) h->GetNumberOfLayers();
|
||||
p.append( item );
|
||||
}
|
||||
else if( hypType()=="LayerDistribution" )
|
||||
{
|
||||
StdMeshers::StdMeshers_LayerDistribution_var h =
|
||||
else if( hypType()=="LayerDistribution" ) {
|
||||
StdMeshers::StdMeshers_LayerDistribution_var h =
|
||||
StdMeshers::StdMeshers_LayerDistribution::_narrow( hyp );
|
||||
|
||||
item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item );
|
||||
@ -811,6 +879,32 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const
|
||||
customWidgets()->append
|
||||
( 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" )
|
||||
{
|
||||
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( "Deflection1D", "DEFLECTION1D" );
|
||||
types.insert( "Arithmetic1D", "ARITHMETIC_1D" );
|
||||
types.insert( "FixedPoints1D", "FIXED_POINTS_1D" );
|
||||
types.insert( "AutomaticLength", "AUTOMATIC_LENGTH" );
|
||||
types.insert( "ProjectionSource1D", "PROJECTION_SOURCE_1D" );
|
||||
types.insert( "ProjectionSource2D", "PROJECTION_SOURCE_2D" );
|
||||
types.insert( "ProjectionSource3D", "PROJECTION_SOURCE_3D" );
|
||||
types.insert( "NumberOfLayers", "NUMBER_OF_LAYERS" );
|
||||
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( "MaxLength", "MAX_LENGTH" );
|
||||
types.insert( "QuadrangleParams", "QUADRANGLE_PARAMS" );
|
||||
@ -1096,13 +1193,6 @@ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & pa
|
||||
param.myValue = w->GetValue();
|
||||
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" ))
|
||||
{
|
||||
const StdMeshersGUI_SubShapeSelectorWdg * w =
|
||||
@ -1110,6 +1200,13 @@ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & pa
|
||||
param.myValue = w->GetValue();
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,10 @@
|
||||
<source>ICON_DLG_ARITHMETIC_1D</source>
|
||||
<translation>mesh_hypo_length.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_DLG_FIXED_POINTS_1D</source>
|
||||
<translation>mesh_hypo_length.png</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>ICON_DLG_AUTOMATIC_LENGTH</source>
|
||||
<translation>mesh_hypo_length.png</translation>
|
||||
|
@ -149,6 +149,14 @@
|
||||
<source>SMESH_LOCAL_LENGTH_TITLE</source>
|
||||
<translation>Hypothesis Construction</translation>
|
||||
</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>
|
||||
<source>SMESH_MAX_LENGTH_HYPOTHESIS</source>
|
||||
<translation>Max Length</translation>
|
||||
@ -246,8 +254,24 @@
|
||||
<translation>Remove row</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>SMESH_REVERCE_EDGES</source>
|
||||
<translation>Reverce Edges</translation>
|
||||
<source>SMESH_REVERSED_EDGES</source>
|
||||
<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>
|
||||
<source>SMESH_BASE_VERTEX</source>
|
||||
|
@ -32,6 +32,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_LocalLength_i.hxx \
|
||||
StdMeshers_StartEndLength_i.hxx \
|
||||
StdMeshers_Arithmetic1D_i.hxx \
|
||||
StdMeshers_FixedPoints1D_i.hxx \
|
||||
StdMeshers_NumberOfSegments_i.hxx \
|
||||
StdMeshers_Deflection1D_i.hxx \
|
||||
StdMeshers_Propagation_i.hxx \
|
||||
@ -47,6 +48,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_QuadranglePreference_i.hxx \
|
||||
StdMeshers_QuadraticMesh_i.hxx \
|
||||
StdMeshers_NumberOfLayers_i.hxx \
|
||||
StdMeshers_NumberOfLayers2D_i.hxx \
|
||||
StdMeshers_Prism_3D_i.hxx \
|
||||
StdMeshers_ProjectionSource1D_i.hxx \
|
||||
StdMeshers_ProjectionSource2D_i.hxx \
|
||||
@ -54,6 +56,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_Projection_1D_2D_3D_i.hxx \
|
||||
StdMeshers_ObjRefUlils.hxx \
|
||||
StdMeshers_LayerDistribution_i.hxx \
|
||||
StdMeshers_LayerDistribution2D_i.hxx \
|
||||
StdMeshers_CompositeSegment_1D_i.hxx \
|
||||
StdMeshers_SegmentAroundVertex_0D_i.hxx \
|
||||
StdMeshers_SegmentLengthAroundVertex_i.hxx \
|
||||
@ -61,6 +64,7 @@ salomeinclude_HEADERS = \
|
||||
StdMeshers_TrianglePreference_i.hxx \
|
||||
StdMeshers_MaxLength_i.hxx \
|
||||
StdMeshers_QuadrangleParams_i.hxx \
|
||||
StdMeshers_RadialQuadrangle_1D2D_i.hxx \
|
||||
SMESH_StdMeshers_I.hxx
|
||||
|
||||
# Libraries targets
|
||||
@ -71,6 +75,7 @@ dist_libStdMeshersEngine_la_SOURCES = \
|
||||
StdMeshers_LocalLength_i.cxx \
|
||||
StdMeshers_StartEndLength_i.cxx \
|
||||
StdMeshers_Arithmetic1D_i.cxx \
|
||||
StdMeshers_FixedPoints1D_i.cxx \
|
||||
StdMeshers_NumberOfSegments_i.cxx \
|
||||
StdMeshers_Deflection1D_i.cxx \
|
||||
StdMeshers_Propagation_i.cxx \
|
||||
@ -86,6 +91,7 @@ dist_libStdMeshersEngine_la_SOURCES = \
|
||||
StdMeshers_QuadranglePreference_i.cxx \
|
||||
StdMeshers_QuadraticMesh_i.cxx \
|
||||
StdMeshers_NumberOfLayers_i.cxx \
|
||||
StdMeshers_NumberOfLayers2D_i.cxx \
|
||||
StdMeshers_Prism_3D_i.cxx \
|
||||
StdMeshers_ProjectionSource1D_i.cxx \
|
||||
StdMeshers_ProjectionSource2D_i.cxx \
|
||||
@ -93,13 +99,15 @@ dist_libStdMeshersEngine_la_SOURCES = \
|
||||
StdMeshers_Projection_1D_2D_3D_i.cxx \
|
||||
StdMeshers_ObjRefUlils.cxx \
|
||||
StdMeshers_LayerDistribution_i.cxx \
|
||||
StdMeshers_LayerDistribution2D_i.cxx \
|
||||
StdMeshers_CompositeSegment_1D_i.cxx \
|
||||
StdMeshers_SegmentAroundVertex_0D_i.cxx \
|
||||
StdMeshers_SegmentLengthAroundVertex_i.cxx \
|
||||
StdMeshers_UseExisting_1D2D_i.cxx \
|
||||
StdMeshers_TrianglePreference_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
|
||||
libStdMeshersEngine_la_CPPFLAGS = \
|
||||
|
290
src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx
Normal file
290
src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx
Normal 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;
|
||||
}
|
||||
|
87
src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx
Normal file
87
src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx
Normal 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
|
95
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
Normal file
95
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.cxx
Normal 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;
|
||||
}
|
||||
|
||||
|
64
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx
Normal file
64
src/StdMeshers_I/StdMeshers_LayerDistribution2D_i.hxx
Normal 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
|
||||
|
94
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
Normal file
94
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.cxx
Normal 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;
|
||||
}
|
||||
|
62
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx
Normal file
62
src/StdMeshers_I/StdMeshers_NumberOfLayers2D_i.hxx
Normal 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
|
||||
|
71
src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx
Normal file
71
src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.cxx
Normal 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;
|
||||
}
|
||||
|
57
src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.hxx
Normal file
57
src/StdMeshers_I/StdMeshers_RadialQuadrangle_1D2D_i.hxx
Normal 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
|
@ -34,6 +34,7 @@
|
||||
#include "StdMeshers_AutomaticLength_i.hxx"
|
||||
#include "StdMeshers_StartEndLength_i.hxx"
|
||||
#include "StdMeshers_Arithmetic1D_i.hxx"
|
||||
#include "StdMeshers_FixedPoints1D_i.hxx"
|
||||
#include "StdMeshers_NumberOfSegments_i.hxx"
|
||||
#include "StdMeshers_Deflection1D_i.hxx"
|
||||
#include "StdMeshers_Propagation_i.hxx"
|
||||
@ -49,6 +50,8 @@
|
||||
#include "StdMeshers_ProjectionSource1D_i.hxx"
|
||||
#include "StdMeshers_NumberOfLayers_i.hxx"
|
||||
#include "StdMeshers_LayerDistribution_i.hxx"
|
||||
#include "StdMeshers_NumberOfLayers2D_i.hxx"
|
||||
#include "StdMeshers_LayerDistribution2D_i.hxx"
|
||||
#include "StdMeshers_SegmentLengthAroundVertex_i.hxx"
|
||||
#include "StdMeshers_MaxLength_i.hxx"
|
||||
#include "StdMeshers_QuadrangleParams_i.hxx"
|
||||
@ -62,6 +65,7 @@
|
||||
#include "StdMeshers_SegmentAroundVertex_0D_i.hxx"
|
||||
#include "StdMeshers_CompositeSegment_1D_i.hxx"
|
||||
#include "StdMeshers_UseExisting_1D2D_i.hxx"
|
||||
#include "StdMeshers_RadialQuadrangle_1D2D_i.hxx"
|
||||
|
||||
|
||||
template <class T> class StdHypothesisCreator_i:public HypothesisCreator_i<T>
|
||||
@ -106,6 +110,8 @@ STDMESHERS_I_EXPORT
|
||||
aCreator = new StdHypothesisCreator_i<StdMeshers_StartEndLength_i>;
|
||||
else if (strcmp(aHypName, "Deflection1D") == 0)
|
||||
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)
|
||||
aCreator = new StdHypothesisCreator_i<StdMeshers_Arithmetic1D_i>;
|
||||
else if (strcmp(aHypName, "AutomaticLength") == 0)
|
||||
@ -126,6 +132,10 @@ STDMESHERS_I_EXPORT
|
||||
aCreator = new StdHypothesisCreator_i<StdMeshers_NumberOfLayers_i>;
|
||||
else if (strcmp(aHypName, "LayerDistribution") == 0)
|
||||
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)
|
||||
aCreator = new StdHypothesisCreator_i<StdMeshers_SegmentLengthAroundVertex_i>;
|
||||
else if (strcmp(aHypName, "QuadrangleParams") == 0)
|
||||
@ -158,6 +168,8 @@ STDMESHERS_I_EXPORT
|
||||
aCreator = new StdHypothesisCreator_i<StdMeshers_UseExisting_1D_i>;
|
||||
else if (strcmp(aHypName, "UseExisting_2D") == 0)
|
||||
aCreator = new StdHypothesisCreator_i<StdMeshers_UseExisting_2D_i>;
|
||||
else if (strcmp(aHypName, "RadialQuadrangle_1D2D") == 0)
|
||||
aCreator = new StdHypothesisCreator_i<StdMeshers_RadialQuadrangle_1D2D_i>;
|
||||
else ;
|
||||
|
||||
return aCreator;
|
||||
|
Loading…
Reference in New Issue
Block a user