CFx SDK Documentation  2020SP3
Public Types | Public Member Functions | Friends | List of all members
OdDbLoftOptions Class Reference

#include <DbLoftOptions.h>

Public Types

enum  NormalOption {
  kNoNormal = 0, kFirstNormal = 1, kLastNormal = 2, kEndsNormal = 3,
  kAllNormal = 4, kUseDraftAngles = 5
}
 

Public Member Functions

 OdDbLoftOptions ()
 
 OdDbLoftOptions (const OdDbLoftOptions &src)
 
 ~OdDbLoftOptions ()
 
OdDbLoftOptionsoperator= (const OdDbLoftOptions &rhs)
 
double draftStart () const
 
void setDraftStart (double angle)
 
double draftEnd () const
 
void setDraftEnd (double angle)
 
double draftStartMag () const
 
void setDraftStartMag (double startMag)
 
double draftEndMag () const
 
void setDraftEndMag (double val)
 
bool arcLengthParam () const
 
void setArcLengthParam (bool alParam)
 
bool noTwist () const
 
void setNoTwist (bool noTwist)
 
bool alignDirection () const
 
void setAlignDirection (bool alignDir)
 
bool simplify () const
 
void setSimplify (bool simplify)
 
bool closed () const
 
void setClosed (bool closed)
 
bool ruled () const
 
void setRuled (bool ruled)
 
bool virtualGuide () const
 
void setVirtualGuide (bool virtGuide)
 
OdDbLoftOptions::NormalOption normal () const
 
void setNormal (OdDbLoftOptions::NormalOption option)
 
OdResult setOptionsFromSysvars (const OdDbDatabase &pDb)
 
OdResult setSysvarsFromOptions (OdDbDatabase &pDb)
 
OdResult checkOptions (bool displayErrorMessages=false)
 
OdResult checkLoftCurves (OdDbEntityPtrArray &crossSectionCurves, OdDbEntityPtrArray &guideCurves, OdDbEntity *pPathCurve, bool &allOpen, bool &allClosed, bool &allPlanar, bool displayErrorMessages=false)
 
OdResult checkCrossSectionCurves (OdDbEntityPtrArray &crossSectionCurves, bool &allOpen, bool &allClosed, bool &allPlanar, bool displayErrorMessages=false)
 
OdResult checkGuideCurves (OdDbEntityPtrArray &guideCurves, bool displayErrorMessages=false)
 
OdResult checkPathCurve (OdDbEntity *pPathCurve, bool displayErrorMessages=false)
 

Friends

class OdDbLoftOptionsImpl
 

Detailed Description

Class for setting options used for creating lofted surfaces and lofted solids (by calling OdDbLoftedSurface::createLoftedSurface() or OdDb3dSolid::createLoftedSolid() methods). Loft options are used to control the shape of the resulting surface or solid object.

<group OdDb_Classes>

Definition at line 40 of file DbLoftOptions.h.

Member Enumeration Documentation

◆ NormalOption

Enumeration for specifying plane normal lofting regimes.

Enumerator
kNoNormal 

Plane normal lofting is off: surface direction is calculated at each cross-section.

kFirstNormal 

Direction of the surface at the first cross-section will be the same as the plane normal of the cross-section.

kLastNormal 

Direction of the surface at the last cross-section will be the same as the plane normal of the cross-section.

kEndsNormal 

Direction of the surface at the first and last cross-sections will be the same as the plane normal of the cross-section.

kAllNormal 

Direction of the surface at each cross-section will be the same as the plane normal of the cross-section.

kUseDraftAngles 

Direction of the surface at each cross-section will be the same as the plane normal of the cross-section.

Definition at line 68 of file DbLoftOptions.h.

Constructor & Destructor Documentation

◆ OdDbLoftOptions() [1/2]

OdDbLoftOptions::OdDbLoftOptions ( )

Creates an OdDbLoftOptions object.

◆ OdDbLoftOptions() [2/2]

OdDbLoftOptions::OdDbLoftOptions ( const OdDbLoftOptions src)

Copy constructor for the OdDbLoftOptions class.

◆ ~OdDbLoftOptions()

OdDbLoftOptions::~OdDbLoftOptions ( )

Destroys the OdDbLoftOptions object.

Member Function Documentation

◆ alignDirection()

bool OdDbLoftOptions::alignDirection ( ) const

Returns the value of the direction alignment flag.

THe direction alignment flag is used to orient each of the cross sections so that the normal vector of each cross section points towards the next cross section. The default value is true. If the cross sections are not all oriented in the same direction, then this flag should be used to avoid creating a twisted or self-intersecting surface.

◆ arcLengthParam()

bool OdDbLoftOptions::arcLengthParam ( ) const

Returns the flag determining whether arc length parameterization is applied.

◆ checkCrossSectionCurves()

OdResult OdDbLoftOptions::checkCrossSectionCurves ( OdDbEntityPtrArray crossSectionCurves,
bool &  allOpen,
bool &  allClosed,
bool &  allPlanar,
bool  displayErrorMessages = false 
)

Checks whether cross section curves are valid for the lofting operation.

Parameters
crossSectionCurves[in] A list of cross-section curves.
allOpen[out] A passed-in parameter indicating whether all of the cross-section curves are open.
allClosed[out] A passed-in parameter indicating whether all of the cross-section curves are closed.
allPlanar[out] A passed-in parameter indicating whether all of the cross-section curves are planar.
displayErrorMessages[in] Indicates whether error messages are displayed. Default value is false.
Returns
Returns eOk if curves are valid or eInvalidInput otherwise.
Remarks
The method is called by createLoftedSurface() and createLoftedSolid() methods, so it is not necessary to call the method separately().

◆ checkGuideCurves()

OdResult OdDbLoftOptions::checkGuideCurves ( OdDbEntityPtrArray guideCurves,
bool  displayErrorMessages = false 
)

Checks whether guide curves are valid for the lofting operation.

Parameters
guideCurves[in] A list of guide curves.
displayErrorMessages[in] Indicates whether error messages are displayed. Default value is false.
Returns
Returns eOk if guide curves are valid or eInvalidInput otherwise.
Remarks
The method is called by createLoftedSurface() and createLoftedSolid() methods, so it is not necessary to call the method separately().

◆ checkLoftCurves()

OdResult OdDbLoftOptions::checkLoftCurves ( OdDbEntityPtrArray crossSectionCurves,
OdDbEntityPtrArray guideCurves,
OdDbEntity pPathCurve,
bool &  allOpen,
bool &  allClosed,
bool &  allPlanar,
bool  displayErrorMessages = false 
)

Checks whether cross section curves and path curves are valid for the lofting operation.

Parameters
crossSectionCurves[in] A list of cross-section curves.
guideCurves[in] A list of guide curves.
pPathCurve[in] A pointer to a path curve (can be NULL).
allOpen[out] A passed-in parameter indicating whether all of the cross-section curves are open.
allClosed[out] A passed-in parameter indicating whether all of the cross-section curves are closed.
allPlanar[out] A passed-in parameter indicating whether all of the cross-section curves are planar.
displayErrorMessages[in] Indicates whether error messages are displayed. Default value is false.
Returns
Returns eOk if curves are valid or eInvalidInput otherwise.
Remarks
The method is called by createLoftedSurface() and createLoftedSolid() methods, so it is not necessary to call the method separately. The method combines calls to check CrossSectionCurves(), checkGuideCurves(), and checkPathCurve() into a single function.

◆ checkOptions()

OdResult OdDbLoftOptions::checkOptions ( bool  displayErrorMessages = false)

Validates the loft options values.

Parameters
displayErrorMessages[in] Indicates whether error messages are displayed. Default value is false.
Returns
Returns eOk if the options values are all valid.

◆ checkPathCurve()

OdResult OdDbLoftOptions::checkPathCurve ( OdDbEntity pPathCurve,
bool  displayErrorMessages = false 
)

Checks whether a path curve is valid for the lofting operation.

Parameters
pPathCurve[in] A pointer to the path curve (can be NULL).
displayErrorMessages[in] Indicates whether error messages are displayed. Default value is false.
Returns
Returns eOk if a path curve is valid or eInvalidInput otherwise.
Remarks

The method is called by createLoftedSurface() and createLoftedSolid() methods, so it is not necessary to call the method separately().

◆ closed()

bool OdDbLoftOptions::closed ( ) const

Returns the value of the closed flag.

If the closed flag is set to true, the created surface starts and ends at the first cross section (i.e. the surface is closed). If all of the cross sections are closed, the resulting surface takes a torus-like shape. If the closed flag is set to false, the surface is opened or capped with a planar surface at the first and last cross sections. If the flag is set, then there must be at least three cross sections.

The default value is false.

◆ draftEnd()

double OdDbLoftOptions::draftEnd ( ) const

Returns the end draft angle in radians. This is the surface take-off direction at the last cross section. The default value is 0; no draft angle is applied and the optimum angle is calculated at the last cross section.

◆ draftEndMag()

double OdDbLoftOptions::draftEndMag ( ) const

Returns the end draft magnitude.

The value returned by the method determines the magnitude of the surface tangent vector at the last cross-section. The default value is 0; the optimum magnitude is calculated at the last cross section.

◆ draftStart()

double OdDbLoftOptions::draftStart ( ) const

Returns the start draft angle in radians. This is the surface take-off direction at the first cross section. The default value is 0; no draft angle is applied and the optimum angle is calculated at the first cross section.

◆ draftStartMag()

double OdDbLoftOptions::draftStartMag ( ) const

Returns the start draft magnitude. The value returned by the method determines the magnitude of the surface tangent vector at the first cross-section. The default value is 0; the optimum magnitude is calculated at the last cross section.

◆ normal()

OdDbLoftOptions::NormalOption OdDbLoftOptions::normal ( ) const

Returns the plane normal flag.

The default value of the flag is kNoNormal.

◆ noTwist()

bool OdDbLoftOptions::noTwist ( ) const

Returns the flag determining whether the noTwist option is applied. THe option noTwist can be used to minimize the amount of twist in the surface when the cross-sections are all closed. The default value is true; the start point of each closed cross-section is aligned with the other cross-sections to minimize twist.

◆ operator=()

OdDbLoftOptions& OdDbLoftOptions::operator= ( const OdDbLoftOptions rhs)

Assigns to the OdDbLoftOptions object another object (assignment operator).

Parameters
rhs[in] Another OdDbLoftOptions object to assign.

◆ ruled()

bool OdDbLoftOptions::ruled ( ) const

Returns the value of the ruled flag.

If the flag is set to true, a ruled surface will be created between each pair of cross sections, which leads to a coarser surface.
If the flag is set to false, then a single smooth surface is created. The default value is false.

◆ setAlignDirection()

void OdDbLoftOptions::setAlignDirection ( bool  alignDir)

Sets the value of the direction alignment flag.

The direction alignment flag is used to orient each of the cross sections so that the normal vector of each cross section points towards the next cross section. The default value is true. If the cross sections are not all oriented in the same direction, then this flag should be used to avoid creating a twisted or self-intersecting surface.

Parameters
alignDir[in] A new value of the direction alignment flag.

◆ setArcLengthParam()

void OdDbLoftOptions::setArcLengthParam ( bool  alParam)

Sets the flag determining whether arc length parameterization is applied.

Parameters
alParam[in] A new value of the arc length parameterizaton flag.

◆ setClosed()

void OdDbLoftOptions::setClosed ( bool  closed)

Sets the value of the closed flag.

If the closed flag is set to true, the created surface starts and ends at the first cross section (i.e. the surface is closed). If all of the cross sections are closed, the resulting surface takes a torus-like shape. If the closed flag is set to false, the surface is opened or capped with a planar surface at the first and last cross sections. If the flag is set, then there must be at least three cross sections.

The default value is false.

Parameters
closed[in] A new value of the closed flag.

◆ setDraftEnd()

void OdDbLoftOptions::setDraftEnd ( double  angle)

Sets the end draft angle. This is the surface take-off direction at the last cross section. The default value is 0; no draft angle is applied and the optimum angle is calculated at the last cross section.

Parameters
angle[in] A new value of the end draft angle (radians).

◆ setDraftEndMag()

void OdDbLoftOptions::setDraftEndMag ( double  val)

Sets the end draft magnitude.

The value set by the method determines the magnitude of the surface tangent vector at the last cross-section. The default value is 0; the optimum magnitude is calculated at the last cross section.

Parameters
startMag[in] A new value of the end draft magnitude.

◆ setDraftStart()

void OdDbLoftOptions::setDraftStart ( double  angle)

Sets the start draft angle. This is the surface take-off direction at the first cross section. The default value is 0; no draft angle is applied and the optimum angle is calculated at the first cross section.

Parameters
angle[in] A new value of the start draft angle (radians).

◆ setDraftStartMag()

void OdDbLoftOptions::setDraftStartMag ( double  startMag)

Sets the start draft magnitude. The value set by the method determines the magnitude of the surface tangent vector at the first cross-section. The default value is 0; the optimum magnitude is calculated at the last cross section.

Parameters
startMag[in] A new value of the start draft magnitude.

◆ setNormal()

void OdDbLoftOptions::setNormal ( OdDbLoftOptions::NormalOption  option)

Sets the plane normal flag. The default value of the flag is kNoNormal.

Parameters
option[in] A new value of the plane normal flag.

◆ setNoTwist()

void OdDbLoftOptions::setNoTwist ( bool  noTwist)

Sets the flag determining whether the noTwist option is applied. The option noTwist can be used due to minimize the amount of twist in the surface when the cross-sections are all closed. The default value is true; the start point of each closed cross-section is aligned with the other cross-sections to minimize twist.

Parameters
noTwist[in] A new value of noTwist flag.

◆ setOptionsFromSysvars()

OdResult OdDbLoftOptions::setOptionsFromSysvars ( const OdDbDatabase pDb)

Sets loft options from the current values of system variables.

Parameters
pDb[in] A reference to a database object that is used to get access to system variable values.
Returns
Returns eOk if options were successfully set or an appropriate error otherwise.

◆ setRuled()

void OdDbLoftOptions::setRuled ( bool  ruled)

Sets the value of the ruled flag.

If the flag is set to true, a ruled surface will be created between each pair of cross sections, which leads to a coarser surface.
If the flag is set to false, then a single smooth surface is created. The default value is false.

Parameters
ruled[in] A new value of the ruled flag.

◆ setSimplify()

void OdDbLoftOptions::setSimplify ( bool  simplify)

Sets the value of the simplify flag.

If the simplify flag is set to true, simple surface types (such as plane, cylinder, cone, sphere and torus) are created whenever all of the cross sections lie on such a surface. If the simplify flag is set to false, a general surface type will be created. The default value is true.

Parameters
simplify[in] A new value of the simplify flag.

◆ setSysvarsFromOptions()

OdResult OdDbLoftOptions::setSysvarsFromOptions ( OdDbDatabase pDb)

Sets the system variables values from loft options values.

Parameters
pDb[out] A reference to a database object that is used to change system variables values.
Returns
Returns eOk if system variables were successfully set or an appropriate error otherwise.

◆ setVirtualGuide()

void OdDbLoftOptions::setVirtualGuide ( bool  virtGuide)

Sets the virtual guide flag.

Parameters
virtGuide[in] A new value of the virtual guide flag.

◆ simplify()

bool OdDbLoftOptions::simplify ( ) const

Returns the value of the simplify flag. If the simplify flag is set to true, simple surface types (such as plane, cylinder, cone, sphere and torus) are created whenever all of the cross sections lie on such a surface. If the simplify flag is set to false, a general surface type will be created. The default value is true.

◆ virtualGuide()

bool OdDbLoftOptions::virtualGuide ( ) const

Returns the virtual guide option.

Friends And Related Function Documentation

◆ OdDbLoftOptionsImpl

friend class OdDbLoftOptionsImpl
friend

Definition at line 395 of file DbLoftOptions.h.


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