All Frameworks Class Hierarchy This Framework Previous Next Indexes
AdvancedTopologicalOpe Class CATTopCleanCrvOperator
Mathematics.CATCGMVirtual
|
+---GeometricObjects.CATCGMOperator
|
+---NewTopologicalObjects.CATTopOperator
|
+---CATTopCleanCrvOperator
Usage: you must use this class as is. You should never derive it.
public class CATTopCleanCrvOperator
Class defining the operator to clean a wire body.
The operator produces a wire topology that is at least (G0) continuous. More over, upon request, it can:
- Enhance the continuity between edges up to the continuity in curvature (G2 continuity).
- Concatenate all the edges sharing vertices that are G2 continuous.
- Allow the continuity enhancement of the wire on a shell topology support (2D cleaning mode).
The operator produces a new wire containing at most the same number of edges than the input wire.
The correction is controlled by the user. The operator can correct:
- Point discontinuities between edges, according to a point discontinuity criterion.
All point discontinuity gaps less than this criterion are corrected to be set to the standard G0 gap
(see CATGeoFactory.GetResolution ).
- Tangency between edges, according to a tangency discontinuity criterion.
The tangency discontinuity angles less than this criterion are corrected to be set to the standard G1 angle
(see
CATGeoFactory.GetResolution ).
- Curvature between edges, according to a curvature vector discontinuity criterion.
Let C1 and C2 be the curvature vectors to edges E1, E2 incident to vertex V.
Define R = |C1 - C2 | / max (|C1|,|C2|) to be the curvature vector ratio.
If R is greater than (1-iCurvatureRatio)/iCurvatureRatio, G2 continuity will
be corrected to the standard G2 value (see
CATGeoFactory.GetResolution ). - Small edges to delete, according to an edge length criterion, upon request.
More over after these corrections, the operator can merge edges that are connected by vertices
that are continuous in curvature.
These operations can be driven in two control modes
CatTopCleanCrvPriorityMode :
This operator follows the general scheme of the topological operators:
- Creates the operator with the CATCreateTopCleanCrvOperator global function, which defines
the wire to clean
- Sets the cleaning parameters
- Runs with the Run method. In case of maximum deformation control mode, if the operator does not find
any solution satisfying all the constraints, an error is thrown.
- Gets the result body by the GetResult method.
The result body contains at most the same number of edges
than the input one. Moreover, one can access to the maximum deformation
between the input body and the result.
- Deletes the operator with the usual C++ delete operator.
Remark : In case of 2D cleaning mode (on shell), the continuity at transition vertices between two
faces could not be enhanced beyond the continuity between both faces. Indeed, the treatment does not
enhance the continuity of the shell.
Constructor and Destructor Index
- o
CATTopCleanCrvOperator(CATGeoFactory*,CATTopData*)
- Do not use.
- o
~CATTopCleanCrvOperator()
-
Method Index
- o
GetC3ContinuityAndCellReduction()
-
- o
GetCellReduction()
- Retrieve the current status of cell reduction defined on operator.
- o
GetContinuityLevel()
- Retrieve the current continuity level to improve defined on operator.
- o
GetDescendantEdge(CATEdge*,CatTopCleanCrvCellStatus&,CATEdge*&)
- Retrieves the result edge corresponding to an input edge.
- o
GetDescendantVertex(CATVertex*,CatTopCleanCrvCellStatus&,CATVertex*&)
- Retrieves the result vertex corresponding to an input vertex.
- o
GetMaxDeformationLocation(CATMathSetOfPoints&,CATMathSetOfPoints&)
- Returns the 3D location on the input wire and the 3D location on the output (corrected) wire
corresponding to the maximum reached deformation.
- o
GetMaxReachedDeformation()
- Returns the maximum deformation between input and output wires.
- o
SetApplyMappingOfInitialVertices(int)
- Allows the activation of the mapping of the input vertices to the output vertices.
- o
SetC1ToC2Management(CATTopCleanCrvC1ToC2Management)
- Defines the way to treat non-C2 edges.
- o
SetC3ContinuityAndCellReduction(CATBoolean)
-
- o
SetCellReduction(CATBoolean)
- Reduce the number of cells after curvature correction.
- o
SetConnexityGap(CATLength)
- Defines the point continuity criterion for G0 correction.
- o
SetConnexityMinGap(CATLength)
- Defines the point continuity criterion below which the G0 correction is not applied.
- o
SetContinuityLevel(CATFrFContinuity)
- Defines the highest continuity level to achieve on the wire.
- o
SetCurvatureRatio(double)
- Defines the curvature criterion for G2 correction.
- o
SetEndExtremityContinuityLevel(CATFrFContinuity)
- Defines the highest continuity level at the END extremity between the input wire and the
result wire.
- o
SetFixedCells(CATLISTP(CATCell)&)
- Defines the set of input edges and vertices that must stay unmodified through the operator.
- o
SetForceFillEdgeTreatment(int)
-
- o
SetForceOneEdgeImprovement(CATBoolean)
- Combined with cell reduction mode, forces the operator to treat either the one-edge-wire case
or any one edge case situated between two unsuppressed vertices.
- o
SetLocalOptimization(int)
-
- o
SetMaxDeformation(CATLength)
- Defines the maximum deformation allowed between the output and input bodies.
- o
SetMinimumEdgeLength(double,CATBoolean)
- Defines the minimum size of an edge to be corrected.
- o
SetModeODT(char*,char*)
- This API should not be used.
- o
SetPriorityMode(CatTopCleanCrvPriorityMode)
- Defines the priority mode of cleaning operations.
- o
SetShell(CATBody*)
- Defines the 2D cleaning mode.
- o
SetShell(CATBody*,CATBoolean)
- Defines the 2D cleaning mode with optional topological wire on shell " LyingOnLink " recovery.
- o
SetSmartClosure()
- To use on Closed Wire with SetCellReduction or SetApplyMappingOfInitialVertices only.
- o
SetStartExtremityContinuityLevel(CATFrFContinuity)
- Defines the highest continuity level at the START extremity between the input wire and the
result wire.
- o
SetTangencyAngle(CATAngle)
- Defines the tangency criteria for G1 correction.
- o
SetTangencyMinAngle(CATAngle)
- Defines the tangency criterion below which the G1 correction is not applied.
Constructor and Destructor
o CATTopCleanCrvOperator
-
Do not use.
Constructor.
Use CATCreateTopCleanCrvOperator to create an
CATTopCleanCrvOperator.
o ~CATTopCleanCrvOperator
public virtual ~CATTopCleanCrvOperator( | ) |
-
Methods
o GetC3ContinuityAndCellReduction
public virtual CATBoolean GetC3ContinuityAndCellReduction( | )=0 |
-
- Deprecated:
- V5R15
Retrieve the current status of cell reduction defined on operator.
o GetCellReduction
-
Retrieve the current status of cell reduction defined on operator.
- Returns:
- The current cell reduction status.
o GetContinuityLevel
-
Retrieve the current continuity level to improve defined on operator.
- Returns:
- The current continuity level.
o GetDescendantEdge
-
Retrieves the result edge corresponding to an input edge.
- Parameters:
-
- iInputEdge
- The pointer to the edge of the input wire.
- oInputEdgeStatus
- The status of the input edge.
- oOutputEdge
- The pointer to the corresponding edge in the result wire.
oOutputEdge is NULL if oInputEdgeStatus equals
CatTopCleanCrvCellDeleted, not null otherwise.
- Returns:
- Not null if iInputEdge is not an edge of the input wire or if edge descendance
is not available.
Edge descendance is not available if
CATTopCleanCrvOperator.SetC3ContinuityAndCellReduction has been required.
o GetDescendantVertex
-
Retrieves the result vertex corresponding to an input vertex.
- Parameters:
-
- iInputVertex
- The pointer to the vertex of the input wire.
- oInputVertexStatus
- The status of the input vertex.
- oOutputVertex
- The pointer to the corresponding vertex in the result wire .
oOutputVertex is NULL if oInputVertexStatus equals
CatTopCleanCrvCellDeleted, not null else.
- Returns:
- Not null if iInputVertex is not a vertex of the input wire.
o GetMaxDeformationLocation
-
Returns the 3D location on the input wire and the 3D location on the output (corrected) wire
corresponding to the maximum reached deformation. These locations are 3D points computed from
the curve geometry of edges. The distance between these two points corresponds to the
maximum reached deformation (see GetMaxReachedDeformation).
This method must be called after the Run method, otherwise a not null value is returned (error).
- Parameters:
-
- oInputLocation
- Point on the input wire.
- oOutputLocation
- Point on the output wire.
- Returns:
- Integer not null in case of error.
o GetMaxReachedDeformation
public virtual CATLength GetMaxReachedDeformation( | )=0 |
-
Returns the maximum deformation between input and output wires.
This method must be called after the Run method.
If the priority mode is CatTopCleanCrvDeformation and if the
and maximum deformation that is reached is greater than the maximum authorized
deformation (
CATTopCleanCrvOperator.SetMaxDeformation ), a NULL body is returned by the GetResult method.
o SetApplyMappingOfInitialVertices
public virtual CATLONG32 SetApplyMappingOfInitialVertices( | const int | iApplyMapping | = 0) = 0 |
-
Allows the activation of the mapping of the input vertices to the output vertices.
- Parameters:
-
- iApplyMapping
- If TRUE AND SetContinuityLevel(CATFrFCurvatureCont) AND SetLocalOptimization(TRUE) AND SetCellReduction(FALSE)
the mapping could be activated then the quality of the wire is very similar to the quality obtained
when the SetCellReduction is set to TRUE (Smoother result) but the vertices are kept.
After deletion of small edges the position of the remained vertices are saved with their
global curvilinear adimensional param (eg Pos(Vi)=Total_Length_From_The_Starting_Extremity_To_Vi/Total_Length_Of_Wire)
then a a global smoothing is applyied on a reduced wire and the vertices are reinserted at
New_Pos(Vi)=Pos(Vi)*New_Total_Length_Of_Wire.
- Returns:
- Not null in case of error.
o SetC1ToC2Management
public virtual CATLONG32 SetC1ToC2Management( | CATTopCleanCrvC1ToC2Management | iC1ToC2Managment)=0 |
-
Defines the way to treat non-C2 edges.
- Parameters:
-
- iC1ToC2Managment
- By default the value is CATTopCleanCrvDefaultC1ToC2Management
Legal values:
- CATTopCleanCrvNoC1ToC2Management
- No special treatment would be applied
- CATTopCleanCrvDefaultC1ToC2Management
- Edges that need a modification
and that are not C2 continuous would be C2 continous in the result.
- CATTopCleanCrvAllCurvesC1ToC2Management
- All non-C2-continuous Edges would be
C2 continous in the result.
- Returns:
- Not null in case of error.
o SetC3ContinuityAndCellReduction
-
- Deprecated:
- V5R15
Activate the C3 correction and cell reduction.
- Parameters:
-
- iC3Mode
- iC3Mode = TRUE to ask for C3 continuity correction and cell reduction of the wire.
The operator concatenates all the result edges sharing vertices that are C3 continuous,
and creates vertices at points that are not.
Point, tangency and curvature continuity corrections will automatically be performed, controlled
by the associated continuity thresholds.
if C3 correction an cell reduction is required, the edge descendance informations given
by
CATTopCleanCrvOperator.GetDescendantEdge are not available.
- Returns:
- Not null in case of error.
o SetCellReduction
-
Reduce the number of cells after curvature correction.
- Parameters:
-
- iCellReduction
- iCellReduction = TRUE to concatenate all the result edges sharing vertices that are G2 continuous.
If is CellReduction is required it is recommanded for better stability to use it in CATFrFCurvatureCont
correction mode.
- Returns:
- Not null in case of error.
o SetConnexityGap
-
Defines the point continuity criterion for G0 correction.
- Parameters:
-
- iConnexityGap
- The G0 continuity criterion, set by default to the factory resolution.
This applies to vertices connecting edges.
All point discontinuity gaps less than this criterion are corrected to be set to the standard G0 gap.
- Returns:
- Not null in case of error.
o SetConnexityMinGap
-
Defines the point continuity criterion below which the G0 correction is not applied.
- Parameters:
-
- iConnexityMinGap
- The G0 continuity criterion minimum, set by default to 0.
If the distance between two consecutives Edges < iConnexityMinGap, then
G0 correction is not applied.
Default value : 0.
+---------------+-------------------------------+------------------> G0 Gap
0 iConnexityMinGap iConnexityGap
Correction : NO YES NO
- Returns:
- Not null in case of error.
o SetContinuityLevel
-
Defines the highest continuity level to achieve on the wire.
- Parameters:
-
- iContinuityLevel
- The continuity level, set by default to CATFrFTangentCont for tangency continuity.
Legal values:
- CATFrFPointCont
- To limit the continuity correction to point continuity correction
- CATFrFTangentCont
- To limit the continuity correction to tangency continuity correction
- CATFrFCurvatureCont
- To limit the continuity correction to curvature continuity correction.
A given continuity order can be reached only if its inferior continuity levels are also reached,
according to the continuity correction parameters defined by SetConnexityGap, SetTangencyAngle,
SetCurvatureRatio, SetConnexityMinGap,SetTangencyMinAngle.
- Returns:
- Not null in case of error.
o SetCurvatureRatio
public virtual CATLONG32 SetCurvatureRatio( | double | iCurvatureRatio)=0 |
-
Defines the curvature criterion for G2 correction.
- Parameters:
-
- iCurvatureRatio
- The curvature ratio in ]0..1], set by default to 0.98.
Let C1 and C2 be the curvature vectors to edges E1, E2 incident to vertex V.
Let R = |C1 - C2 | / max (|C1|,|C2|) be the curvature vector ratio.
If R is greater than (1-iCurvatureRatio)/iCurvatureRatio, G2 continuity will
be corrected to the standard G2 value.
The more a vertex V is G2 continuous, the more iCurvatureRatio is near 1.
The less a vertex V is G2 continuous, the more iCurvatureRatio is near 0 (excluded).
Give a value near of 0 to try to make G2 all vertices, near 1 to only correct vertices
that are already quite G2.
To be G2 corrected, vertex V must be G1 in the input wire, or must have been corrected
in G1 by the cleaning process.
- Returns:
- Not null in case of error.
o SetEndExtremityContinuityLevel
-
Defines the highest continuity level at the END extremity between the input wire and the
result wire.
- Parameters:
-
- iEndContLevel
- The continuity level, set by default to CATFrFCurvatureCont for curvature continuity.
Legal values:
- CATFrFPointCont
- To limit the continuity to point continuity
- CATFrFTangentCont
- To limit the continuity to tangency continuity
- CATFrFCurvatureCont
- To limit the continuity to curvature continuity.
- Returns:
- Not null in case of error.
o SetFixedCells
-
Defines the set of input edges and vertices that must stay unmodified through the operator.
The list only contains edges and/or vertices of the input wire. An error is send if not.
These cells will be reproduced as the same as they are in the input wire, and their
underlying geometry will not be modified.
- Returns:
- Not null in case of error.
o SetForceFillEdgeTreatment
public virtual CATLONG32 SetForceFillEdgeTreatment( | const int | iForceFillEdgeTreatment | = 0)=0 |
-
- Deprecated:
- V5R15
do not use
o SetForceOneEdgeImprovement
-
Combined with cell reduction mode, forces the operator to treat either the one-edge-wire case
or any one edge case situated between two unsuppressed vertices.
In the case of an one-edge-wire, the result wire is by default exactly the same as the input.
- Parameters:
-
- iEnable
- By default FALSE.
Legal values:
TRUE Forces the operator to treat one edge if cell reduction is activated : a smoothing based
on absolute wire length is applied.
FALSE If there is only one edge in the wire or for cases with one edge between two vertices,
nothing is done.
- Returns:
- Not null in case of error.
o SetLocalOptimization
public virtual CATLONG32 SetLocalOptimization( | const int | iOptimization | = 0) = 0 |
-
- Deprecated:
- V5R15
To use local optimization. ONLY AVAILABLE WITH "Deformation" OPTION
Local optimization means : new connections are computed to minimize the 3th derivative of
the curves (3 order energy). The goal is to reduce oscillations of curvature combs.
The result could be close to we picture.
iOptimization = 1 = ON, iOptimization = 0 = OFF (default);
o SetMaxDeformation
-
Defines the maximum deformation allowed between the output and input bodies.
- Parameters:
-
- iMaxDeformation
- The deformation value, set by default to 0.001.
This parameter will be used only when working in CatTopCleanCrvDeformation priority mode.
- Returns:
- Not null in case of error.
o SetMinimumEdgeLength
public virtual CATLONG32 SetMinimumEdgeLength( | double | iMinEdgeLength, |
| CATBoolean | iAbsoluteMinEdgeLength | =TRUE)=0 |
-
Defines the minimum size of an edge to be corrected.
- Parameters:
-
- iMinimumEdgeLength
- The minimum edge length to be kept, set by default to 10 * Factory resolution.
All edges which length is less than iAbsoluteMinEdgeLength are removed.
- iAbsoluteMinEdgeLength
-
Legal values:
TRUE if iMinimumEdgeLength is the absolute wire length,
FALSE the iMinEdgeLength is understood as a percentile of the total wire length.
In this case if the wire as a total length Lall edges of length l are considered as small edges
if and only if l<=iMinEdgeLength*L.
- Returns:
- Not null in case of error.
o SetModeODT
public virtual void SetModeODT( | char* | iScenarioNameStr, |
| char* | iInputFileNameStr)=0 |
-
This API should not be used.
o SetPriorityMode
-
Defines the priority mode of cleaning operations.
- Parameters:
-
- iMode
- The mode value. By default, it is set CatTopCleanCrvContinuity.
Legal values:
- CatTopCleanCrvContinuity
- No Limitation of the deformation.
- CatTopCleanCrvDeformation
- To limit the deformation (see also SetMaxDeformation).
Note : For a better quality result it is recommanded to use the CatTopCleanCrvDeformation
and not the default mode.
- Returns:
- Not null in case of error.
o SetShell
-
Defines the 2D cleaning mode.
- Parameters:
-
- iShellBody
- The shell body on which the wire is cleaned.
The topological wire on shell " LyingOnLink " must exist. That is a warranty the
wire edges to clean are geometrically represented on the iShellBody faces.
- Returns:
- Not null if iShellBody is a NULL pointer.
An error is thrown if iShellBody is not made of a single shell.
An error is thrown if the wire on shell " LyingOnLink " does not exist.
o SetShell
-
Defines the 2D cleaning mode with optional topological wire on shell " LyingOnLink " recovery.
- Parameters:
-
- iShellBody
- The shell body on which the wire is cleaned.
- iLyingOnLinkRecovery
- On TRUE, enables the recovery of the topological wire on shell " LyingOnLink " if absent.
In this case, the wire edges to clean must be geometrically represented on the
iShellBody faces.
On FALSE, the topological wire on shell " LyingOnLink " must exist.
- Returns:
- Not null if iShellBody is a NULL pointer.
An error is thrown if iShellBody is not made of a single shell.
An error is thrown if the wire edges are not geometrically represented on the
iShellBody faces when recovery option is enabled (TRUE).
o SetSmartClosure
public virtual CATLONG32 SetSmartClosure( | )= 0 |
-
To use on Closed Wire with SetCellReduction or SetApplyMappingOfInitialVertices only.
This allow the CATTopCleanCrvOperator to modify where is the Closure Vertex of the wire.
Note : by default the operator does not change where is the closure vertex.
- Parameters:
-
- iVertex
-
Legal values:
NULL (Default) the operator automatically choose a closure vertex with the following preferences.
- If SetShell is used (2D Clean) the closure vertex will be at a transition between two faces.
- the closure vertex will be at a vertex that will not be G0 after clean.
- the closure vertex will be at a vertex that will not be G1 after clean.
- the closure vertex will be at a vertex that will not be G2 after clean.
- Returns:
- Not null in case of error.
o SetStartExtremityContinuityLevel
-
Defines the highest continuity level at the START extremity between the input wire and the
result wire.
- Parameters:
-
- iStartContLevel
- The continuity level, set by default to CATFrFCurvatureCont for curvature continuity.
Legal values:
- CATFrFPointCont
- To limit the continuity to point continuity
- CATFrFTangentCont
- To limit the continuity to tangency continuity
- CATFrFCurvatureCont
- To limit the continuity to curvature continuity.
- Returns:
- Not null in case of error.
o SetTangencyAngle
-
Defines the tangency criteria for G1 correction.
- Parameters:
-
- iTangencyAngle
- The tangence angle in degrees, set by default to 0.5 degree.
iTangencyAngle is the upper value under which a tangency correction (G1) will be performed.
Let T1 and T2 be the tangents to the edges E1, E2 incident to vertex V.
If |T1-T2| is less than iTangencyAngle, it will be corrected to the standard G1 value.
To be G1 corrected, vertex V must be G0 in the input wire,
or must have been corrected in G0 by the cleaning process.
- Returns:
- Not null in case of error.
o SetTangencyMinAngle
-
Defines the tangency criterion below which the G1 correction is not applied.
- Parameters:
-
- iTangencyMinAngle
- The tangence angle minimum in degrees, set by default to 0 degree.
If |T1,T2| < iTangencyMinAngle, then G1 correction is not applied.
+---------------+-------------------------------+------------------> G1 Gap
0 iTangencyMinAngle iTangencyAngle
Correction : NO YES NO
This object is included in the file: CATTopCleanCrvOperator.h
If needed, your Imakefile.mk should include the module: CATAdvancedTopologicalOpe