Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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...
 
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)
 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 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 CurveCreator::Coordinates getPoints (const int theISection=-1) const
 Get points of a section (the total points in Curve if theISection is equal to -1). More...
 
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...
 

Protected Types

typedef std::list
< CurveCreator_Diff
ListDiff
 

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 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
 

Private Attributes

int myNbUndos
 
int myNbRedos
 
ListDiff::iterator myCurrenPos
 
ListDiff myListDiffs
 
int myUndoDepth
 
int myOpLevel
 
AIS_Shape * myAISShape
 AIS shape. More...
 

Additional Inherited Members

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

Member Typedef Documentation

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

Constructor & Destructor Documentation

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 ( )
virtual

References clear().

Member Function Documentation

bool CurveCreator_Curve::addEmptyDiff ( )
protectedvirtual

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

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

bool CurveCreator_Curve::addPoints ( const CurveCreator::Coordinates theCoords,
const int  theISection,
const int  theIPnt = -1 
)
virtual
bool CurveCreator_Curve::addPointsInternal ( const CurveCreator::SectionsMap theSectionsMap)
virtual
int CurveCreator_Curve::addSection ( const std::string &  theName,
const CurveCreator::SectionType  theType,
const bool  theIsClosed 
)
virtual
int CurveCreator_Curve::addSection ( const std::string &  theName,
const CurveCreator::SectionType  theType,
const bool  theIsClosed,
const CurveCreator::Coordinates thePoints 
)
virtual
int CurveCreator_Curve::addSectionInternal ( const std::string &  theName,
const CurveCreator::SectionType  theType,
const bool  theIsClosed,
const CurveCreator::Coordinates thePoints 
)
virtual
bool CurveCreator_Curve::canPointsBeSorted ( )
virtual

Implements CurveCreator_ICurve.

bool CurveCreator_Curve::clear ( )
virtual
bool CurveCreator_Curve::clearInternal ( )
virtual
void CurveCreator_Curve::constructAISObject ( )
protectedvirtual
void CurveCreator_Curve::convert ( const SectionToPointList thePoints,
std::map< int, std::list< int > > &  theConvPoints 
)
protected
Parameters
thePointsan source list
theConvPointsa converted map
void CurveCreator_Curve::finishOperation ( )
virtual

References myOpLevel.

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

Implements CurveCreator_ICurve.

References myDimension.

CurveCreator_Displayer * CurveCreator_Curve::getDisplayer ( )

References myDisplayer.

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

Implements CurveCreator_ICurve.

References myNbRedos.

int CurveCreator_Curve::getNbSections ( ) const
virtual

Implements CurveCreator_ICurve.

References mySections.

int CurveCreator_Curve::getNbUndo ( ) const
virtual

Implements CurveCreator_ICurve.

References myNbUndos.

CurveCreator::Coordinates CurveCreator_Curve::getPoint ( const int  theISection,
const int  theIPnt 
) const
virtual
CurveCreator::Coordinates CurveCreator_Curve::getPoints ( const int  theISection = -1) const
virtual
const CurveCreator_ISection* CurveCreator_Curve::getSection ( const int  theSectionIndex) const
inlinevirtual

Implements CurveCreator_ICurve.

References NULL.

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

Implements CurveCreator_ICurve.

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

Returns specified section name.

Implements CurveCreator_ICurve.

References getSection(), and CurveCreator_Section::myName.

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

References myUndoDepth.

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

Reimplemented from CurveCreator_ICurve.

bool CurveCreator_Curve::isClosed ( const int  theISection) const
virtual
bool CurveCreator_Curve::join ( const std::list< int > &  theSections)
virtual
bool CurveCreator_Curve::joinInternal ( const std::list< int > &  theSections)
virtual
bool CurveCreator_Curve::moveSection ( const int  theISection,
const int  theNewIndex 
)
virtual
bool CurveCreator_Curve::moveSectionInternal ( const int  theISection,
const int  theNewIndex 
)
virtual

References anIter(), getSection(), and mySections.

void CurveCreator_Curve::redisplayCurve ( )
protected
bool CurveCreator_Curve::redo ( )
virtual

Implements CurveCreator_ICurve.

References myCurrenPos, myNbRedos, and myNbUndos.

void CurveCreator_Curve::removeDisplayer ( )
virtual

References myDisplayer, and NULL.

bool CurveCreator_Curve::removePoint ( const int  theISection,
const int  theIPnt = -1 
)
virtual
bool CurveCreator_Curve::removePointsInternal ( const SectionToPointList thePoints)
virtual
bool CurveCreator_Curve::removeSection ( const int  theISection)
virtual
bool CurveCreator_Curve::removeSectionInternal ( const int  theISection)
virtual

References mySections, and redisplayCurve().

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

References getDimension(), getSection(), CurveCreator_Section::myPoints, and toICoord().

bool CurveCreator_Curve::removeSeveralPoints ( const SectionToPointList theSectionToPntIDs)
virtual
void CurveCreator_Curve::saveCoordDiff ( const SectionToPointCoordsList theOldCoords)
virtual
Parameters
theOldCoordsthe old points coordinates

Implements CurveCreator_ICurve.

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

bool CurveCreator_Curve::setClosed ( const int  theISection,
const bool  theIsClosed 
)
virtual
bool CurveCreator_Curve::setClosedInternal ( const int  theISection,
const bool  theIsClosed 
)
virtual
void CurveCreator_Curve::setDisplayer ( CurveCreator_Displayer theDisplayer)
virtual

References myDisplayer.

bool CurveCreator_Curve::setPoint ( const int  theISection,
const int  theIPnt,
const CurveCreator::Coordinates theNewCoords 
)
virtual
bool CurveCreator_Curve::setPointInternal ( const CurveCreator::SectionsMap theSectionsMap)
virtual
bool CurveCreator_Curve::setSectionName ( const int  theISection,
const std::string &  theName 
)
virtual
bool CurveCreator_Curve::setSectionNameInternal ( const int  theISection,
const std::string &  theName 
)
virtual
bool CurveCreator_Curve::setSectionType ( const int  theISection,
const CurveCreator::SectionType  theType 
)
virtual
bool CurveCreator_Curve::setSectionTypeInternal ( const int  theISection,
const CurveCreator::SectionType  theType 
)
virtual
bool CurveCreator_Curve::setSeveralPoints ( const SectionToPointCoordsList theSectionToPntCoords,
const bool  theIsToSaveDiff = true 
)
virtual
void CurveCreator_Curve::setSkipSorting ( const bool  theIsToSkip)
virtual

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

Implements CurveCreator_ICurve.

References mySkipSorting.

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

References myOpLevel.

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

References myDimension.

bool CurveCreator_Curve::undo ( )
virtual

Implements CurveCreator_ICurve.

References myCurrenPos, myNbRedos, and myNbUndos.

Member Data Documentation

AIS_Shape* CurveCreator_Curve::myAISShape
private
ListDiff::iterator CurveCreator_Curve::myCurrenPos
private
CurveCreator::Dimension CurveCreator_Curve::myDimension
CurveCreator_Displayer* CurveCreator_Curve::myDisplayer
bool CurveCreator_Curve::myIsLocked
ListDiff CurveCreator_Curve::myListDiffs
private
int CurveCreator_Curve::myNbRedos
private
int CurveCreator_Curve::myNbUndos
private
int CurveCreator_Curve::myOpLevel
private
CurveCreator::Sections CurveCreator_Curve::mySections
bool CurveCreator_Curve::mySkipSorting
protected
int CurveCreator_Curve::myUndoDepth
private

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