SHAPER  9.15.0
PartSet_PreviewSketchPlane Class Reference

Visualization of 2D-bluebrint' accessories: translucent rectangular substrate, basis axes, grid. More...

Public Types

enum  GridSnappingMode { Off , SnapAnyway , SnapInProximity }
 

Public Member Functions

 PartSet_PreviewSketchPlane (PartSet_SketcherMgr *theManager)
 
 PartSet_PreviewSketchPlane (const PartSet_PreviewSketchPlane &)=delete
 
PartSet_PreviewSketchPlaneoperator= (const PartSet_PreviewSketchPlane &)=delete
 
void savePreferencesIntoSketchData (std::shared_ptr< ModelAPI_CompositeFeature > theSketch) const
 
void saveRectangularGridPreferencesIntoSketchData (std::shared_ptr< ModelAPI_CompositeFeature > theSketch) const
 
void saveCircularGridPreferencesIntoSketchData (std::shared_ptr< ModelAPI_CompositeFeature > theSketch) const
 
void setCSAndSize (const gp_Ax3 &theCS, double theSize)
 Updates CS (coordinate system), dimensions and accessories' configuration. More...
 
bool setAllUsingSketch (std::shared_ptr< ModelAPI_CompositeFeature > theSketch)
 Updates CS (coordinate system), dimensions and accessories' configuration. Updates visibility of accessories - visibility preferences are also retrieved from theSketch data. If sketch data contains uninitialized grid steps, the method assigns default ones. For rectangular grid default step is a fraction of corresponding dimension. More...
 
bool reconfigureGrid ()
 Call it, after any preference of grid, except grid type, is changed using methods of this instance. Updates grid configuration. Does not affect visibility of grid. More...
 
bool reconfigureGridUsingSketch (std::shared_ptr< ModelAPI_CompositeFeature > theSketch)
 Call it, after any preference of grid is changed in theSketch data directly. Updates grid configuration. Updates grid visibility - preference is also retrieved from theSketch data. If sketch data contains uninitialized grid steps, the method assigns default ones. For rectangular grid default step is a fraction of corresponding dimension. More...
 
bool showAxes (bool theShow)
 
bool showSubstrate (bool theShow)
 
bool setGridType (PartSet_Tools::SketchPlaneGridType::Enum theType)
 Changes grid type and reconfigures grid. Shows grid, if theType != SketchPlaneGridType::No. More...
 
PartSet_Tools::SketchPlaneGridType::Enum getGridType () const
 
void hideAll ()
 Hides all accessories. More...
 
std::pair< double, double > getDimensions () const
 Substrate dimensions. Substrate dimension coincides with one of the sketch face, if the latter is non-zero. More...
 
bool isShowAxes () const
 
bool isShowSubstrate () const
 
bool isShowGrid () const
 
GridSnappingMode getGridSnappingMode () const
 
void setGridSnappingMode (GridSnappingMode theMode)
 
void resetRectangularGrid ()
 Sets default steps and zero offsets. More...
 
void setRectangularGridStepX (double theStepX)
 
void setRectangularGridStepY (double theStepY)
 
std::pair< double, double > getRectangularGridSteps () const
 
void setRectangularGridOffsetX (double theOffsetX)
 
void setRectangularGridOffsetY (double theOffsetY)
 
void setRectangularGridOffsetA (double theOffsetAngle)
 
std::pair< std::pair< double, double >, double > getRectangularGridOffsets () const
 
int getRectangularGridDimOfNodeSpace () const
 
void resetCircularGrid ()
 Sets default steps and zero offsets. More...
 
void setCircularGridRadialStep (double theStep)
 
void setCircularGridNumOfAngularSegments (int theNum)
 
std::pair< double, int > getCircularGrid_dR_and_NAS () const
 
void setCircularGridOffsetX (double theOffset)
 
void setCircularGridOffsetY (double theOffset)
 
void setCircularGridOffsetA (double theOffset)
 
std::pair< std::pair< double, double >, double > getCircularGridOffsets () const
 
int getCircularGridDimOfNodeSpace () const
 
void setUseSizeOfView (const bool isUseSizeOfView)
 
bool isUseSizeOfView () const
 

Static Public Member Functions

static bool SketchAccessoryDbg ()
 
static bool SketchAccessoryDbg (const QString &theString)
 
static bool SketchAccessoryDbg (const char *theString)
 
static bool SketchAccessoryDbg (const char *theCSDescription, const gp_Ax3 &theCS)
 
static bool SketchAccessoryDbg (const char *theCSDescription, const gp_Pnt &thePoint)
 
static bool SketchAccessoryDbg (const char *theCSDescription, const gp_Trsf &theMatrix)
 
static double defaultSketchSize ()
 

Static Public Attributes

static const double DEFAULT_RELATIVE_STEP_INVERSE = 20
 
static const int DEFAULT_NUM_OF_ANGULAR_SECTIONS = 18
 
static const int SNAP_PROXIMITY_P = 10
 

Detailed Description

Visualization of 2D-bluebrint' accessories: translucent rectangular substrate, basis axes, grid.

All methods do not modify sketch data, unless otherwise is stated.

Constructor & Destructor Documentation

◆ PartSet_PreviewSketchPlane()

PartSet_PreviewSketchPlane::PartSet_PreviewSketchPlane ( PartSet_SketcherMgr theManager)
Parameters
theManagermust not be nullptr.

Member Function Documentation

◆ setCSAndSize()

void PartSet_PreviewSketchPlane::setCSAndSize ( const gp_Ax3 &  theCS,
double  theSize 
)

Updates CS (coordinate system), dimensions and accessories' configuration.

◆ setAllUsingSketch()

bool PartSet_PreviewSketchPlane::setAllUsingSketch ( std::shared_ptr< ModelAPI_CompositeFeature theSketch)

Updates CS (coordinate system), dimensions and accessories' configuration. Updates visibility of accessories - visibility preferences are also retrieved from theSketch data. If sketch data contains uninitialized grid steps, the method assigns default ones. For rectangular grid default step is a fraction of corresponding dimension.

Returns
true, on success (if theSketch is valid).

◆ reconfigureGrid()

bool PartSet_PreviewSketchPlane::reconfigureGrid ( )

Call it, after any preference of grid, except grid type, is changed using methods of this instance. Updates grid configuration. Does not affect visibility of grid.

Returns
true, if grid is successfully configured.

◆ reconfigureGridUsingSketch()

bool PartSet_PreviewSketchPlane::reconfigureGridUsingSketch ( std::shared_ptr< ModelAPI_CompositeFeature theSketch)

Call it, after any preference of grid is changed in theSketch data directly. Updates grid configuration. Updates grid visibility - preference is also retrieved from theSketch data. If sketch data contains uninitialized grid steps, the method assigns default ones. For rectangular grid default step is a fraction of corresponding dimension.

Returns
true, if grid is successfully configured.

◆ showAxes()

bool PartSet_PreviewSketchPlane::showAxes ( bool  theShow)
Returns
true on success.

◆ showSubstrate()

bool PartSet_PreviewSketchPlane::showSubstrate ( bool  theShow)
Returns
true on success.

◆ setGridType()

bool PartSet_PreviewSketchPlane::setGridType ( PartSet_Tools::SketchPlaneGridType::Enum  theType)

Changes grid type and reconfigures grid. Shows grid, if theType != SketchPlaneGridType::No.

Returns
true on success.

◆ hideAll()

void PartSet_PreviewSketchPlane::hideAll ( )

Hides all accessories.

◆ getDimensions()

std::pair< double, double > PartSet_PreviewSketchPlane::getDimensions ( ) const

Substrate dimensions. Substrate dimension coincides with one of the sketch face, if the latter is non-zero.

◆ resetRectangularGrid()

void PartSet_PreviewSketchPlane::resetRectangularGrid ( )

Sets default steps and zero offsets.

◆ resetCircularGrid()

void PartSet_PreviewSketchPlane::resetCircularGrid ( )

Sets default steps and zero offsets.

◆ defaultSketchSize()

double PartSet_PreviewSketchPlane::defaultSketchSize ( )
static
Returns
Default size from Config_PropManager (if > 0), or DEFAULT_SKETCH_SIZE.