Version: 9.12.0
CurveCreator_Curve Class Reference

The CurveCreator_Curve object is represented as one or more sets of connected points; thus CurveCreator_Curve object can contain several not connected curves (polylines or b-splines), each such curve has two only ends "start and end points" in other words non-manifold curves are not supported.

#include <CurveCreator_Curve.hxx>

Inheritance diagram for CurveCreator_Curve:
Inheritance graph

Public Member Functions

 CurveCreator_Curve (const CurveCreator::Dimension theDimension)
 Constructor of the curve. More...
 
virtual ~CurveCreator_Curve ()
 Destructor. More...
 
virtual CurveCreator::Dimension getDimension () const
 Get the dimension. More...
 
virtual std::string getUniqSectionName () const
 Return unique section name. More...
 
virtual void setDisplayer (CurveCreator_Displayer *theDisplayer)
 Set curve creator Displayer object. More...
 
CurveCreator_DisplayergetDisplayer ()
 Return curve creator Displayer object. More...
 
virtual void removeDisplayer ()
 Remove curve creator Displayer object. More...
 
virtual void setUndoDepth (const int theDepth=-1)
 Set depth of undo operations (unlimited if theDepth is -1 or disabled if theDepth is 0) More...
 
virtual int getUndoDepth () const
 Get depth of undo operations. More...
 
virtual void startOperation ()
 
virtual void finishOperation ()
 
virtual int toICoord (const int theIPnt) const
 This method converts the point index to the index in an array of coordinates. More...
 
virtual bool moveSectionInternal (const int theISection, const int theNewIndex)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool moveSection (const int theISection, const int theNewIndex)
 Move section to new position in list. More...
 
void getCoordinates (int theISection, int theIPoint, double &theX, double &theY, double &theZ) const
 
virtual int getNbUndo () const
 Get number of available undo operations. More...
 
virtual bool undo ()
 Undo previous operation. More...
 
virtual int getNbRedo () const
 Get number of available redo operations. More...
 
virtual bool redo ()
 Redo last previously "undone" operation. More...
 
virtual bool clearInternal ()
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool clear ()
 Clear the polyline (remove all sections) More...
 
void SetEraseAllState (bool toEraseAll)
 set erase-all state if true => erase all objects from viever, else remove only the current curve More...
 
bool GetEraseAllState () const
 get erase-all state if true => erase all objects from viever, else remove only the current curve More...
 
virtual bool joinInternal (const std::list< int > &theSections)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool join (const std::list< int > &theSections)
 Join list of sections to one section (join all if the list is empty) More...
 
virtual int getNbSections () const
 Get number of sections. More...
 
virtual int addSectionInternal (const std::string &theName, const CurveCreator::SectionType theType, const bool theIsClosed, const CurveCreator::Coordinates &thePoints, const Quantity_Color &aColor)
 For internal use only! Undo/Redo are not used here. More...
 
virtual int addSection (const std::string &theName, const CurveCreator::SectionType theType, const bool theIsClosed)
 Add a new section. More...
 
virtual int addSection (const std::string &theName, const CurveCreator::SectionType theType, const bool theIsClosed, const CurveCreator::Coordinates &thePoints)
 Add a new section. More...
 
virtual bool removeSectionInternal (const int theISection)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool removeSection (const int theISection)
 Removes the given sections. More...
 
virtual bool isClosed (const int theISection) const
 Get "closed" flag of the specified section. More...
 
virtual bool setClosedInternal (const int theISection, const bool theIsClosed)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool setClosed (const int theISection, const bool theIsClosed)
 Set "closed" flag of the specified section (all sections if theISection is -1). More...
 
virtual bool setColorSection (int SectInd, Quantity_Color theNewColor)
 Sets color of section by index. More...
 
virtual void setColorSectionInternal (int SectInd, Quantity_Color theNewColor)
 For internal use only! Undo/Redo are not used here. More...
 
virtual Quantity_Color getLastRemovedColor () const
 
virtual void popLastRemovedColor ()
 
virtual Quantity_Color getColorSection (int SectInd) const
 Gets color of section by index. More...
 
virtual std::string getSectionName (const int theISection) const
 Returns specifyed section name. More...
 
virtual bool setSectionNameInternal (const int theISection, const std::string &theName)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool setSectionName (const int theISection, const std::string &theName)
 Set name of the specified section. More...
 
virtual CurveCreator::SectionType getSectionType (const int theISection) const
 Get type of the specified section. More...
 
virtual bool setSectionTypeInternal (const int theISection, const CurveCreator::SectionType theType)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool setSectionType (const int theISection, const CurveCreator::SectionType theType)
 Set type of the specified section (or all sections if theISection is -1). More...
 
const CurveCreator_ISectiongetSection (const int theSectionIndex) const
 A virtual method. More...
 
CurveCreator_ISectiongetSection (const int theSectionIndex)
 A virtual method. More...
 
virtual bool addPointsInternal (const CurveCreator::SectionsMap &theSectionsMap)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool addPoints (const CurveCreator::Coordinates &theCoords, const int theISection, const int theIPnt=-1)
 Add one point to the specified section starting from the given theIPnt index (or at the end of points if theIPnt is -1). More...
 
virtual bool setPointInternal (const CurveCreator::SectionsMap &theSectionsMap)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool setPoint (const int theISection, const int theIPnt, const CurveCreator::Coordinates &theNewCoords)
 Set coordinates of specified point. More...
 
virtual bool setSeveralPoints (const SectionToPointCoordsList &theSectionToPntCoords, const bool theIsToSaveDiff=true)
 Set coordinates of specified points from different sections. More...
 
virtual bool removePointsInternal (const SectionToPointList &thePoints)
 For internal use only! Undo/Redo are not used here. More...
 
virtual bool removePoint (const int theISection, const int theIPnt=-1)
 Remove point with given id. More...
 
virtual bool removeSeveralPoints (const SectionToPointList &theSectionToPntIDs)
 Remove several points from different sections with given ids. More...
 
virtual CurveCreator::Coordinates getPoint (const int theISection, const int theIPnt) const
 Get coordinates of specified point. More...
 
virtual Handle (TColgp_HArray1OfPnt) GetDifferentPoints(int theISection
 Get points of a section (the total points in Curve if theISection is equal to -1). More...
 
CurveCreator::Coordinates getCoords (int theISection=-1) const
 
virtual int getNbPoints (const int theISection) const
 Get number of points in specified section or (the total number of points in Curve if theISection is equal to -1). More...
 
virtual void setSkipSorting (const bool theIsToSkip)
 Set skip sorting flag. More...
 
virtual bool canPointsBeSorted ()
 Indicates whether the points can be sorted. More...
 
virtual void saveCoordDiff (const SectionToPointCoordsList &theOldCoords)
 Saves points coordinates difference. More...
 
virtual Handle (AIS_InteractiveObject) getAISObject(const bool theNeedToBuild
 Get the curve AIS object. More...
 
- Public Member Functions inherited from CurveCreator_ICurve
virtual ~CurveCreator_ICurve ()
 The destructor. More...
 

Public Attributes

bool myIsLocked
 
CurveCreator::Sections mySections
 curve data More...
 
CurveCreator::Dimension myDimension
 curve dimension More...
 
CurveCreator_DisplayermyDisplayer
 curve displayer More...
 
Quantity_Color myPointAspectColor
 
double myLineWidth
 
NCollection_IndexedDataMap< int, TopoDS_Shape > mySect2Shape
 
std::vector< int > myCurSectInd
 

Protected Types

typedef std::list< CurveCreator_DiffListDiff
 

Protected Member Functions

virtual bool addEmptyDiff ()
 This method updates all undo/redo information required to be updated after curve modification operation. More...
 
void redisplayCurve (bool preEraseAllObjects=true)
 
bool removeSectionPoints (const int theSectionId, const std::list< int > &thePointIds)
 Removes the points from the section. More...
 
void convert (const SectionToPointList &thePoints, std::map< int, std::list< int > > &theConvPoints)
 Converts the list of pairs of section to point into map of a section to list of points. More...
 
virtual void constructAISObject ()
 

Protected Attributes

bool mySkipSorting
 
AIS_Shape * myAISShape
 AIS shape. More...
 

Private Attributes

int myNbUndos
 
int myNbRedos
 
ListDiff::iterator myCurrenPos
 
ListDiff myListDiffs
 
int myUndoDepth
 
int myOpLevel
 
bool myEraseAll
 
std::vector< Quantity_Color > myRemColors
 

Additional Inherited Members

- Public Types inherited from CurveCreator_ICurve
typedef std::pair< int, int > SectionToPoint
 
typedef std::deque< SectionToPointSectionToPointList
 
typedef std::deque< std::pair< SectionToPoint, CurveCreator::Coordinates > > SectionToPointCoordsList
 

Member Typedef Documentation

◆ ListDiff

typedef std::list<CurveCreator_Diff> CurveCreator_Curve::ListDiff
protected

Constructor & Destructor Documentation

◆ CurveCreator_Curve()

CurveCreator_Curve::CurveCreator_Curve ( const CurveCreator::Dimension  theDimension)

The dimension is explicitly specified in the constructor and cannot be changed later.

◆ ~CurveCreator_Curve()

CurveCreator_Curve::~CurveCreator_Curve ( )
virtual

References clear().

Member Function Documentation

◆ addEmptyDiff()

bool CurveCreator_Curve::addEmptyDiff ( )
protectedvirtual

It returns false if undo/redo is disabled and true otherwise.

References myCurrenPos, myListDiffs, myNbRedos, myNbUndos, and myUndoDepth.

◆ addPoints()

bool CurveCreator_Curve::addPoints ( const CurveCreator::Coordinates theCoords,
const int  theISection,
const int  theIPnt = -1 
)
virtual

◆ addPointsInternal()

bool CurveCreator_Curve::addPointsInternal ( const CurveCreator::SectionsMap theSectionsMap)
virtual

◆ addSection() [1/2]

int CurveCreator_Curve::addSection ( const std::string &  theName,
const CurveCreator::SectionType  theType,
const bool  theIsClosed 
)
virtual

◆ addSection() [2/2]

int CurveCreator_Curve::addSection ( const std::string &  theName,
const CurveCreator::SectionType  theType,
const bool  theIsClosed,
const CurveCreator::Coordinates thePoints 
)
virtual

◆ addSectionInternal()

int CurveCreator_Curve::addSectionInternal ( const std::string &  theName,
const CurveCreator::SectionType  theType,
const bool  theIsClosed,
const CurveCreator::Coordinates thePoints,
const Quantity_Color &  aColor 
)
virtual

◆ canPointsBeSorted()

bool CurveCreator_Curve::canPointsBeSorted ( )
virtual

Implements CurveCreator_ICurve.

◆ clear()

bool CurveCreator_Curve::clear ( )
virtual

◆ clearInternal()

◆ constructAISObject()

virtual void CurveCreator_Curve::constructAISObject ( )
protectedvirtual

Implements CurveCreator_ICurve.

◆ convert()

void CurveCreator_Curve::convert ( const SectionToPointList thePoints,
std::map< int, std::list< int > > &  theConvPoints 
)
protected
Parameters
thePointsan source list
theConvPointsa converted map

◆ finishOperation()

void CurveCreator_Curve::finishOperation ( )
virtual

References myOpLevel.

◆ getColorSection()

Quantity_Color CurveCreator_Curve::getColorSection ( int  SectInd) const
virtual

◆ getCoordinates()

void CurveCreator_Curve::getCoordinates ( int  theISection,
int  theIPoint,
double &  theX,
double &  theY,
double &  theZ 
) const

◆ getCoords()

CurveCreator::Coordinates CurveCreator_Curve::getCoords ( int  theISection = -1) const

◆ getDimension()

CurveCreator::Dimension CurveCreator_Curve::getDimension ( ) const
virtual

Implements CurveCreator_ICurve.

References myDimension.

◆ getDisplayer()

CurveCreator_Displayer * CurveCreator_Curve::getDisplayer ( )

References myDisplayer.

◆ GetEraseAllState()

bool CurveCreator_Curve::GetEraseAllState ( ) const

References myEraseAll.

◆ getLastRemovedColor()

Quantity_Color CurveCreator_Curve::getLastRemovedColor ( ) const
virtual

References myRemColors.

◆ getNbPoints()

int CurveCreator_Curve::getNbPoints ( const int  theISection) const
virtual

◆ getNbRedo()

int CurveCreator_Curve::getNbRedo ( ) const
virtual

Implements CurveCreator_ICurve.

References myNbRedos.

◆ getNbSections()

int CurveCreator_Curve::getNbSections ( ) const
virtual

Implements CurveCreator_ICurve.

References mySections.

◆ getNbUndo()

int CurveCreator_Curve::getNbUndo ( ) const
virtual

Implements CurveCreator_ICurve.

References myNbUndos.

◆ getPoint()

CurveCreator::Coordinates CurveCreator_Curve::getPoint ( const int  theISection,
const int  theIPnt 
) const
virtual

◆ getSection() [1/2]

CurveCreator_ISection* CurveCreator_Curve::getSection ( const int  theSectionIndex)
inlinevirtual

Implements CurveCreator_ICurve.

◆ getSection() [2/2]

const CurveCreator_ISection* CurveCreator_Curve::getSection ( const int  theSectionIndex) const
inlinevirtual

Implements CurveCreator_ICurve.

◆ getSectionName()

std::string CurveCreator_Curve::getSectionName ( const int  theISection) const
virtual

Returns specified section name.

Implements CurveCreator_ICurve.

References getSection(), and CurveCreator_Section::myName.

◆ getSectionType()

CurveCreator::SectionType CurveCreator_Curve::getSectionType ( const int  theISection) const
virtual

◆ getUndoDepth()

int CurveCreator_Curve::getUndoDepth ( ) const
virtual

References myUndoDepth.

◆ getUniqSectionName()

std::string CurveCreator_Curve::getUniqSectionName ( ) const
virtual

◆ Handle() [1/2]

virtual CurveCreator_Curve::Handle ( AIS_InteractiveObject  ) const
virtual

Reimplemented from CurveCreator_ICurve.

◆ Handle() [2/2]

virtual CurveCreator_Curve::Handle ( TColgp_HArray1OfPnt  )
virtual

Reimplemented from CurveCreator_ICurve.

◆ isClosed()

bool CurveCreator_Curve::isClosed ( const int  theISection) const
virtual

◆ join()

bool CurveCreator_Curve::join ( const std::list< int > &  theSections)
virtual

◆ joinInternal()

bool CurveCreator_Curve::joinInternal ( const std::list< int > &  theSections)
virtual

◆ moveSection()

bool CurveCreator_Curve::moveSection ( const int  theISection,
const int  theNewIndex 
)
virtual

◆ moveSectionInternal()

bool CurveCreator_Curve::moveSectionInternal ( const int  theISection,
const int  theNewIndex 
)
virtual

References getSection(), and mySections.

◆ popLastRemovedColor()

void CurveCreator_Curve::popLastRemovedColor ( )
virtual

References myRemColors.

◆ redisplayCurve()

void CurveCreator_Curve::redisplayCurve ( bool  preEraseAllObjects = true)
protected

◆ redo()

bool CurveCreator_Curve::redo ( )
virtual

Implements CurveCreator_ICurve.

References myCurrenPos, myNbRedos, and myNbUndos.

◆ removeDisplayer()

void CurveCreator_Curve::removeDisplayer ( )
virtual

References myDisplayer.

◆ removePoint()

bool CurveCreator_Curve::removePoint ( const int  theISection,
const int  theIPnt = -1 
)
virtual

◆ removePointsInternal()

bool CurveCreator_Curve::removePointsInternal ( const SectionToPointList thePoints)
virtual

◆ removeSection()

bool CurveCreator_Curve::removeSection ( const int  theISection)
virtual

◆ removeSectionInternal()

bool CurveCreator_Curve::removeSectionInternal ( const int  theISection)
virtual

◆ removeSectionPoints()

bool CurveCreator_Curve::removeSectionPoints ( const int  theSectionId,
const std::list< int > &  thePointIds 
)
protected

It sortes the points and remove them in the decreasing order

Parameters
theSectionIda section index
thePointIdsa list of section points

◆ removeSeveralPoints()

bool CurveCreator_Curve::removeSeveralPoints ( const SectionToPointList theSectionToPntIDs)
virtual

◆ saveCoordDiff()

void CurveCreator_Curve::saveCoordDiff ( const SectionToPointCoordsList theOldCoords)
virtual
Parameters
theOldCoordsthe old points coordinates

Implements CurveCreator_ICurve.

References addEmptyDiff(), finishOperation(), myListDiffs, and startOperation().

◆ setClosed()

bool CurveCreator_Curve::setClosed ( const int  theISection,
const bool  theIsClosed 
)
virtual

◆ setClosedInternal()

bool CurveCreator_Curve::setClosedInternal ( const int  theISection,
const bool  theIsClosed 
)
virtual

◆ setColorSection()

bool CurveCreator_Curve::setColorSection ( int  SectInd,
Quantity_Color  theNewColor 
)
virtual

◆ setColorSectionInternal()

void CurveCreator_Curve::setColorSectionInternal ( int  SectInd,
Quantity_Color  theNewColor 
)
virtual

◆ setDisplayer()

void CurveCreator_Curve::setDisplayer ( CurveCreator_Displayer theDisplayer)
virtual

References myDisplayer.

◆ SetEraseAllState()

void CurveCreator_Curve::SetEraseAllState ( bool  toEraseAll)

References myEraseAll.

◆ setPoint()

bool CurveCreator_Curve::setPoint ( const int  theISection,
const int  theIPnt,
const CurveCreator::Coordinates theNewCoords 
)
virtual

◆ setPointInternal()

bool CurveCreator_Curve::setPointInternal ( const CurveCreator::SectionsMap theSectionsMap)
virtual

◆ setSectionName()

bool CurveCreator_Curve::setSectionName ( const int  theISection,
const std::string &  theName 
)
virtual

◆ setSectionNameInternal()

bool CurveCreator_Curve::setSectionNameInternal ( const int  theISection,
const std::string &  theName 
)
virtual

◆ setSectionType()

bool CurveCreator_Curve::setSectionType ( const int  theISection,
const CurveCreator::SectionType  theType 
)
virtual

◆ setSectionTypeInternal()

bool CurveCreator_Curve::setSectionTypeInternal ( const int  theISection,
const CurveCreator::SectionType  theType 
)
virtual

◆ setSeveralPoints()

bool CurveCreator_Curve::setSeveralPoints ( const SectionToPointCoordsList theSectionToPntCoords,
const bool  theIsToSaveDiff = true 
)
virtual

◆ setSkipSorting()

void CurveCreator_Curve::setSkipSorting ( const bool  theIsToSkip)
virtual

If the flag is true - points sorting will be skipped.

Implements CurveCreator_ICurve.

References mySkipSorting.

◆ setUndoDepth()

void CurveCreator_Curve::setUndoDepth ( const int  theDepth = -1)
virtual

◆ startOperation()

void CurveCreator_Curve::startOperation ( )
virtual

References myOpLevel.

◆ toICoord()

int CurveCreator_Curve::toICoord ( const int  theIPnt) const
virtual

References myDimension.

◆ undo()

bool CurveCreator_Curve::undo ( )
virtual

Implements CurveCreator_ICurve.

References myCurrenPos, myNbRedos, and myNbUndos.

Member Data Documentation

◆ myAISShape

AIS_Shape* CurveCreator_Curve::myAISShape
protected

◆ myCurrenPos

ListDiff::iterator CurveCreator_Curve::myCurrenPos
private

◆ myCurSectInd

std::vector<int> CurveCreator_Curve::myCurSectInd

◆ myDimension

CurveCreator::Dimension CurveCreator_Curve::myDimension

◆ myDisplayer

CurveCreator_Displayer* CurveCreator_Curve::myDisplayer

◆ myEraseAll

bool CurveCreator_Curve::myEraseAll
private

◆ myIsLocked

bool CurveCreator_Curve::myIsLocked

◆ myLineWidth

double CurveCreator_Curve::myLineWidth

◆ myListDiffs

ListDiff CurveCreator_Curve::myListDiffs
private

◆ myNbRedos

int CurveCreator_Curve::myNbRedos
private

◆ myNbUndos

int CurveCreator_Curve::myNbUndos
private

◆ myOpLevel

int CurveCreator_Curve::myOpLevel
private

◆ myPointAspectColor

Quantity_Color CurveCreator_Curve::myPointAspectColor

◆ myRemColors

std::vector<Quantity_Color> CurveCreator_Curve::myRemColors
private

◆ mySect2Shape

NCollection_IndexedDataMap<int, TopoDS_Shape> CurveCreator_Curve::mySect2Shape

◆ mySections

CurveCreator::Sections CurveCreator_Curve::mySections

◆ mySkipSorting

bool CurveCreator_Curve::mySkipSorting
protected

◆ myUndoDepth

int CurveCreator_Curve::myUndoDepth
private

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