CFx SDK Documentation  2020SP3
Classes | Public Types | Public Member Functions | List of all members
FacetModeler::Profile2DBool Class Reference

#include <FMProfile2DBool.h>

Classes

class  ArgStub
 

Public Types

enum  Operations {
  eoUnknown = 0, eoOR, eoAND, eoSUB,
  eoXOR, eoLastOper
}
 

Public Member Functions

 Profile2DBool (const OdGeTol &gTol=FMGeGbl::gTol)
 
 ~Profile2DBool ()
 
Profile2DBoolreset (const OdGeTol &gTol=FMGeGbl::gTol)
 
Result evalRegions (Operations eOper, ArgStub rArg1, ArgStub rArg2, Profile2D &rResult)
 
Result evalLinesRegion (Operations eOper, ArgStub rLinesArg, ArgStub rRegionArg, Profile2D &rResult, bool bRegionIsOpen=false)
 
Result evalLines (Operations eOper, ArgStub rArg1, ArgStub rArg2, Profile2D &rResult)
 
Result pushRegion (ArgStub rArg, bool bSaveCopy=true)
 
Result evalPushedRegions (Operations eOper, Profile2D &rResult)
 
Result stencilFlags (ArgStub rSource, ArgStub rStencilRegion, Profile2D &rResult, OdUInt32 uMask, OdUInt32 uInBits, OdUInt32 uOutBits=0, OdUInt32 uBoundaryBits=0)
 

Detailed Description

This class contains methods performing Boolean operations on 2-D regions and lines

Remarks
Regions are given by bounding contours. Contours must be closed and should not be self-intersecting. CCW contour represents region inside it, and CW contour - outside. Lines are given by contours too, but the contours can be closed or not and can intersect each other.

Definition at line 56 of file FMProfile2DBool.h.

Member Enumeration Documentation

◆ Operations

Operation type.

Enumerator
eoUnknown 
eoOR 
eoAND 
eoSUB 
eoXOR 
eoLastOper 

Definition at line 62 of file FMProfile2DBool.h.

Constructor & Destructor Documentation

◆ Profile2DBool()

FacetModeler::Profile2DBool::Profile2DBool ( const OdGeTol gTol = FMGeGbl::gTol)

Constructor.

◆ ~Profile2DBool()

FacetModeler::Profile2DBool::~Profile2DBool ( )

Destructor.

Member Function Documentation

◆ evalLines()

Result FacetModeler::Profile2DBool::evalLines ( Operations  eOper,
ArgStub  rArg1,
ArgStub  rArg2,
Profile2D rResult 
)

Perform Boolean operation on lines

Parameters
eOper[in] operation code. One of: eoOR, eoAND, eoSUB, eoXOR
rArg1[in] first group of lines
rArg1[in] second group of lines
rResult[out] resulting lines (modified only if operation succeeds)
Returns
returns result of operation.
Remarks
rResult can coincide/overlap rArg1 or rArg2 rResult can contain closed or open contours

◆ evalLinesRegion()

Result FacetModeler::Profile2DBool::evalLinesRegion ( Operations  eOper,
ArgStub  rLinesArg,
ArgStub  rRegionArg,
Profile2D rResult,
bool  bRegionIsOpen = false 
)

Cuts lines (rLinesArg) by a region (rArg2) and returns

Parameters
eOper[in] operation code. One of: eoAND, eoSUB
rLinesArg[in] contours, which should be cut
rRegionArg[in] contours of the cutting region
rResult[out] resulting contours (modified only if operation succeeds)
bRegionIsOpen[in] if true, region boundary points are not included in the cutting region
Returns
returns result of operation.
Remarks
rResult can coincide/overlap rLinesArg or rRegionArg rResult can contain closed or open contours

◆ evalPushedRegions()

Result FacetModeler::Profile2DBool::evalPushedRegions ( Operations  eOper,
Profile2D rResult 
)

Performs Boolean operation on multiple regions

Parameters
eOper[in] operation code. One of: eoOR, eoAND, eoSUB, eoXOR
rResult[out] resulting region (modified only if operation succeeds)
Remarks
This method can be called with different eOper and rResult values on the same set of input arguments. For example, you can call pushRegions few times to add arguments and then call evalPushedRegions twice to get union (eoOR) and intersection (eoAND) of these arguments.

◆ evalRegions()

Result FacetModeler::Profile2DBool::evalRegions ( Operations  eOper,
ArgStub  rArg1,
ArgStub  rArg2,
Profile2D rResult 
)

Performs Boolean operation on 2 regions

Parameters
eOper[in] operation code. One of: eoOR, eoAND, eoSUB, eoXOR
rArg1[in] contours of the first region
rArg2[in] contours of the second region
rResult[out] resulting region (modified only if operation succeeds)
Returns
returns result of operation.
Remarks
rResult can coincide/overlap rArg1 or rArg2

◆ pushRegion()

Result FacetModeler::Profile2DBool::pushRegion ( ArgStub  rArg,
bool  bSaveCopy = true 
)

Store a reference to perform some operation(s) later

Parameters
rArg[in] region (closed contours) to store
Remarks
If error is returned, the operation should not be continued and this->reset should be called. reset() should be called to start new sequence of arguments

◆ reset()

Profile2DBool& FacetModeler::Profile2DBool::reset ( const OdGeTol gTol = FMGeGbl::gTol)

Resets the intersector to default values and updates tolerance

◆ stencilFlags()

Result FacetModeler::Profile2DBool::stencilFlags ( ArgStub  rSource,
ArgStub  rStencilRegion,
Profile2D rResult,
OdUInt32  uMask,
OdUInt32  uInBits,
OdUInt32  uOutBits = 0,
OdUInt32  uBoundaryBits = 0 
)

Intersects rSource with rStencilRegion and stores modified source contours with updated metadata in rResult

Parameters
rSource[in] sorce contours (open, closed, any )
rStencilRegion[in] contours of the stencil region
rResult[out] resulting contours (modified only if operation succeeds)
uMask[in] flags to modify. use OdUInt32(-1) to modify all flags
uInBits[in] set these bits on segments inside rStencilRegion
uOutBits[in] set these bits on segments outside rStencilRegion
uBoundaryBits[in] set these bits on boundary segments
Returns
returns result of operation.
Remarks
rResult can coincide/overlap rSource or rStencilRegion

Example: What stencilFlags( cSrc, cStencil, cSrc, 0x1F, 0x1, 0x0, 0x3 ) does ? It splits cSrc segments by cStencil (so that every resulting segment lays either inside or outside or on boundary of cStencil region). Then it updates metadata() values of the resulting segments. It clears 5 lower bits (0x1F) of all metadata and then sets bit 0 (0x1) on inside segments and bits 0 and 1 (0x3) on boundary ones.


The documentation for this class was generated from the following file: