To work with ODA BimRv SDK fill patterns, use the following classes.
OdBmFillPattern resides in the OdBmFillPatternElem object and represents a set of fill grids that form a pattern.
OdBmFillPattern has the following members:
To get this data, use the appropriate methods. For example:
// Get FillPattern data
name = pFillPat->getName();
orientation = pFillPat->getOrientation();
target = pFillPat->getTarget();
windowSize = pFillPat->getWindowSize();
OdBmFillPatternElem is an element wrapper for the OdBmFillPattern class. It does not contain any specific data and it is used only to access OdBmFillPattern. References to OdBmFillPatternElem can be found in the OdBmMaterial and OdBmFilledRegionAttributes classes.
To get the fill pattern, use the getFillPattern() method. For example:
OdBmFillPatternPtr pFillPat = pFillPatEl->getFillPattern();
OdBmFillGrid is a minimal element of which a fill pattern is formed. It defines a set of angled lines with spacing that starts with an offset and can have a pattern. There are two types of grids: simple and custom.
OdBmFillGrid is controlled by following attributes (they are shown in the picture below):
To get this data, use the appropriate methods. For example:
pFillPat->getFillGrids(fillGridArr);
if (!fillGridArr.getAt(1).isNull())
pFillGrid = fillGridArr.getAt(1);
// Get OdBmFillGrid data
angle = pFillGrid->getAngle();
originGrid = pFillGrid->getOrigin();
deltas[0] = pFillGrid->getDeltasItem(0);
deltas[1] = pFillGrid->getDeltasItem(1);
pFillGrid->getSegments(segments);
OdBmFillPatternTable resides in StyleSettings and exists as a dummy table. There are no specific attributes.
OdBmLinePatternTracking is the manager that stores default fill patterns.
OdBmGFilling is an OdBmFace attribute that controls fill pattern application to the face. As faces are processed by BRepRenderer, fill patterns are also applied by BRepRenderer with help from OdBmGFilling.
OdBmGFilling has the following important attributes:
To get this data, use the appropriate methods. For example:
// Get OdBmGFilling data
OdBmCmColor color = pGFilling->getFillColor();
OdBmObjectId parentId = pGFilling->getPatternId();
//OdBmFillPatternDataPtr pFillPatData = pGFilling->getData();
OdBmFillPatternPlacerPtr pFillPatPlacer = pGFilling->getPlacer();
OdBmFillPatternPlacer is an important face attribute that should be taken into account when a fill pattern is applied to a face. It controls the start point and orientation of the pattern application. ODA BimRv SDK uses a 2D coordinate system for FillPatterns that lies on the plane of the face. So, every face has its own coordinate system. This coordinate system is saved as XVector, YVector and Origin of the corresponding OdBmPlane.
OdBmFillPatternPlacer has the following important attributes:
To get this data, use the appropriate methods. For example:
// Get OdBmFillPatternPlacer data
double scale = pFillPatPlacer->getScale();
OdGePoint2d originPatPlacer = pFillPatPlacer->getOrigin();
OdGeVector2d direction = pFillPatPlacer->getDirection();
The hierarchy of the Fill pattern classes is shown on picture below:
To see the full sample find Examples/TB_DevGuideCommands/BmDocFillPatternsCmd
sample command
inside your ODA BimRv SDK installation folder.
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.
|