Aimsun Next Scripting  22
Public Types | Public Member Functions | List of all members
GKBezierCurve Class Reference
Inheritance diagram for GKBezierCurve:
GKPolyline GKGeoObject GKObject GKBaseObject GKObjectConnection GKSection GKSuperNodeTrajectory GKTurning GKCenConnection

Public Types

enum  GKBezierCurveType { eSegment = 0 , eSimpleCurve = 1 , eCurve = 2 }
 
- Public Types inherited from GKGeoObject
enum  GKGeoContainer { eNothing = 0 , ePartially = 1 , eTotally = 2 }
 
- Public Types inherited from GKObject
enum  IdentifierFormFlag {
  eIdentifierDefault , eIdentifierId , eIdentifierName , eIdentifierExternalId ,
  eIdentifierTypeExternalName , eIdentifierDescription , eIdentifierStandard , eIdentifierStandardWithType ,
  eIdentifierAll
}
 
enum  GKLockType { eNone , eModification , eDelete , eModificationDelete }
 
enum  GKObjectStatus { eNew , eSaved , eModified , eDeleted }
 
typedef QFlags< GKObject::IdentifierFormFlagIdentifierForm
 

Public Member Functions

 GKBezierCurve ()
 
void addSegment (GKBezierCurveType type)
 
void setPoint (int s, int i, const GKPoint &p)
 
void setPoint (int i, const GKPoint &p)
 
void setCurve (const GKBezierCurve &curve)
 
void setFromSegment (const GKPoint &p1, const GKPoint &p2, GKBezierCurveType type)
 
void setFromPoints (const GKPoints &ps, GKBezierCurveType type)
 
uint getNbSegments () const
 
virtual void addCurvePointAt (int pos, const GKPoint &p)
 
virtual void removePoint (uint pos)
 
virtual bool canPointBeAdded (uint pos) const
 
GKPoints calculatePolyline (uint nbpoints=0, bool simplify=true, QVector< int > *segmentsBeginPos=NULL) const
 
bool isASegment () const
 
bool onlyContainsSegments () const
 
GKBezierCurveType getCurveType (uint pos) const
 
GKCoord length2D (uint nbpoints=0) const
 
GKCoord length3D (uint nbpoints=0) const
 
GKCoord getSegmentLength (uint pos, uint nbpoints=0) const
 
GKBezierCurve getSegment (uint pos) const
 
int getNumSegmentControlPoints (int pos) const
 
GKPoint calculateBezierPoint (float t) const
 
GKVector calculateBezierDerivative (float t) const
 
GKVector calculateBezierSecondDerivative (float t) const
 
GKCoord calculateBezierRadius (const GKPoints &p, uint nbpoints=0) const
 
GKCoord getBezierRadiusatPoint (const GKPoints &p, const GKPoint &p1, uint nbpoints=0) const
 
GKCoord MeanRadius (uint nbpoints=0) const
 
bool hit (const GKPoint &p, float epsilon) const
 
virtual void changeDirection ()
 
virtual void join (const GKPolyline *pol, bool atStart)
 
virtual void removePoints (uint nbPoints, bool atStart, int &nbSegmentsRemoved)
 
GKPoint pointAtPos (float pos) const
 
float posAtPoint (const GKPoint &p, GKCoord maxDistToCurve=0.01) const
 
int segmentAtPos (GKCoord pos, double *length=NULL) const
 
int segmentAtPosComplete (const GKPoints &points, GKCoord pos, double *retLength=NULL) const
 
uint nbParts () const
 
GKCoord angleToCurve (const GKBezierCurve &curve) const
 
virtual GKCoord getAltitude () const
 
virtual void setAltitude (GKCoord value)
 
- Public Member Functions inherited from GKPolyline
 GKPolyline ()
 
uint nbPoints () const
 
const GKPointgetPoint (uint at) const
 
void setPoint (uint at, const GKPoint &p)
 
const GKPointsgetPoints () const
 
virtual void addPoint (const GKPoint &p)
 
virtual void addPointAt (int pos, const GKPoint &p)
 
virtual void removePoint (uint pos)
 
virtual void setPoints (const GKPoints &ps)
 
virtual GKCoord length2D () const
 
virtual GKCoord length3D () const
 
virtual bool canPointBeAdded (uint pos) const
 
virtual void join (const GKPolyline *pol, bool atStart)
 
virtual void removePoints (uint nbPoints, bool atStart)
 
virtual bool canBeJoined (const GKPolyline *pol) const
 
void prepend (const GKPoints &ps)
 
void add (const GKPoints &ps)
 
void setPointSelected (uint p, bool value)
 
bool isPointSelected (uint p) const
 
void selectAllPoints ()
 
void unselectAllPoints ()
 
int getNbSelPoints () const
 
virtual void changeDirection ()
 
GKCoord getSlope (int segmentPos) const
 
GKBBox getBBox () const
 
void setPenColor (const QColor &color)
 
virtual const QColor & getPenColor () const
 
void setPenStyle (const Qt::PenStyle &astyle)
 
const Qt::PenStyle & getPenStyle () const
 
void setPenSize (float size)
 
float getPenSize () const
 
void setPenSizeUnits (const GK::SizeUnits &units)
 
const GK::SizeUnitsgetPenSizeUnits () const
 
- Public Member Functions inherited from GKGeoObject
 GKGeoObject ()
 
virtual void setSelected (bool newState)
 
virtual bool isSelected () const
 
bool canBeModified () const
 
bool canBeEdited () const
 
virtual bool canBeGrouped () const
 
int getMark () const
 
void setMark (int newMark)
 
void addMark (int newMark)
 
void unmark ()
 
const QVector< int > * getMarks () const
 
uint getNumberOfMarks () const
 
GKLayergetLayer () const
 
void setLayer (GKLayer *alayer)
 
virtual void translate (const GKPoint &delta)
 
virtual void rotate (const GKPoint &center, double angle)
 
virtual void scale (const GKPoint &)
 
virtual GKCoord getAltitude () const
 
virtual void setAltitude (GKCoord value)
 
void addTopObject (GKGeoObject *)
 
QSet< GKGeoObject * > * getTopObjects () const
 
GKGeoObjectgetBottomObject () const
 
void setLabeled (bool value)
 
bool isLabeled () const
 
GKGeoContainer getContainedWay (const GKPoints &points, const GKBBox &bboxPoints) const
 
virtual GKGeoContainer doGetContainedWay (const GKBBox &myBBox, const GKPoints &points, const GKBBox &bboxPoints) const
 
GK::ConnectionType objectConnectionType (const GKGeoObject *object) const
 
QSet< GKObjectConnection * > getConnections () const
 
QSet< GKObjectConnection * > getConnections (const GKGeoObject *) const
 
bool anyConnection (const GKGeoObject *) const
 
virtual void addConnection (GKObjectConnection *)
 
virtual void removeConnection (GKObjectConnection *, GK::ObjectDeletionBehaviour)
 
virtual void changeConnectionObject (GKGeoObject *oldObject, GKGeoObject *newObject, GK::ConnectionType connectionType=GK::eConnectionUndefined)
 
virtual void removeAllConnections (GK::ObjectDeletionBehaviour)
 
virtual bool acceptConnection (GKGeoObject *object) const
 
virtual GKGeoObjectCutCmd * getCutCmd (const GKPoint &from, const GKPoint &to, bool keepConnection)
 
virtual bool exists (quint32 scenarioId) const
 
- Public Member Functions inherited from GKObject
 GKObject ()
 
 GKObject (const GKObject &o)
 
virtual void addedToCatalog ()
 
virtual void removedFromCatalog ()
 
uint getTick () const
 
virtual void increaseTick ()
 
void setTick (uint t)
 
virtual GKObjectclone (bool addItToModel=true) const
 
virtual GKObjectcloneAsTemporary (bool addItToModel=true) const
 
GKFoldergetCreateRootFolder ()
 
GKFoldergetRootFolder () const
 
void setRootFolder (GKFolder *afolder)
 
GKFolderfindFolder (const QString &byName) const
 
QVector< GKFolder * > getParentFolders () const
 
bool isDataValueNull (const GKColumn *attr) const
 
virtual QVariant * getDataValue (const GKColumn *attr, bool *deleteit, const GKContext &context=GKContext::anyContext) const
 
QVariant * getDataValueByID (uint attrId, bool *deleteit, const GKContext &context=GKContext::anyContext) const
 
virtual void setDataValue (const GKColumn *attr, const QVariant &v)
 
void setDataValueByID (uint attrId, const QVariant &v)
 
virtual void setDataValueObject (const GKColumn *attr, const GKObject *obj)
 
void setDataValueObjectByID (uint attrId, const GKObject *obj)
 
virtual void setDataValueDouble (const GKColumn *attr, double v)
 
void setDataValueDoubleByID (uint attrId, double v)
 
virtual double getDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double *deviation=NULL) const
 
double getDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double *deviation=NULL) const
 
bool hasAnyTSWithData () const
 
virtual GKTimeSeriegetDataValueTS (const GKColumn *attr) const
 
GKTimeSeriegetDataValueTSByID (uint attrId) const
 
virtual void setDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, double lowerValue, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setDataValueInSingleTS (const GKColumn *attr, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription)
 
void setDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double value, double deviation, GKTSDescription *aDescription=NULL, int reservedSize=0)
 
virtual void setAggregatedValueInTS (const GKColumn *attr, double value, double deviation, GKTSDescription *aDescription=NULL)
 
void setAggregatedValueInTSByID (uint attrId, double value, double deviation, GKTSDescription *aDescription=NULL)
 
virtual void clearDataValueTS (const GKColumn *attr, GKTSDescription *aDescription=NULL)
 
void clearDataValueTSByID (uint attrId, GKTSDescription *aDescription=NULL)
 
virtual int getDataValueInt (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
int getDataValueIntByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual double getDataValueDouble (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
double getDataValueDoubleByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QString getDataValueString (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QString getDataValueStringByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual bool getDataValueBool (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
bool getDataValueBoolByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
virtual GKObjectgetDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
GKObjectgetDataValueObjectByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QDate getDataValueDate (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QDate getDataValueDateByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QTime getDataValueTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QTime getDataValueTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
QDateTime getDataValueDateTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
QDateTime getDataValueDateTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
GKTimeDuration getDataValueTimeDuration (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const
 
GKTimeDuration getDataValueTimeDurationByID (uint attrId, const GKContext &context=GKContext::anyContext) const
 
void removeDataValue (const GKColumn *attr)
 
void removeDataValueByID (uint attrId)
 
const QString & getDescription () const
 
void setDescription (const QString &adescription)
 
const QString & getExternalId () const
 
void setExternalId (const QString &anId)
 
virtual GKObjectDelCmd * getDelCmd ()
 
virtual GKObjectConnectionDelCmd * getDelConnectionCmd (GKObject *target)
 
virtual void nonCommandObjectRemoved (GKObject *)
 
virtual void init ()
 
virtual void setId (uint aid, GKModel *model)
 
uint getId () const
 
QUuid getUUID () const
 
virtual void setName (const QString &aname)
 
const QString & getName () const
 
QString getExtendedId (IdentifierForm form=eIdentifierDefault) const
 
QString getNameOrExtendedId (IdentifierForm form=eIdentifierDefault) const
 
virtual const QString & getTypeName () const
 
virtual QString getTypeExternalName () const
 
const GKObjectgetMaster () const
 
GKTypegetType () const
 
virtual void setType (GKType *atype)
 
bool isA (const GKType *atype) const
 
bool isA (const QString &typeName) const
 
virtual void setModel (GKModel *amodel)
 
GKModelgetModel () const
 
virtual void setLock (GKLockType atype)
 
GKLockType getLock () const
 
virtual bool canBeDeleted () const
 
virtual bool canBeModified () const
 
virtual bool canBeEdited () const
 
GKObjectStatus getStatus () const
 
virtual void setStatus (const GKObjectStatus astatus)
 
void notifyStatusChange ()
 
bool isTemporary () const
 
void setTemporary (bool value)
 
bool isExternal () const
 
void setExternal (bool value)
 
virtual void preferencesChanged ()
 
void removeColumn (GKColumn *column)
 
void resetColumn (GKColumn *column)
 
- Public Member Functions inherited from GKBaseObject
 GKBaseObject ()
 
 if (base)
 
virtual uint getId () const =0
 
virtual const QString & getTypeName () const =0
 
virtual QString getTypeExternalName () const =0
 
virtual const GKObjectgetMaster () const =0
 
virtual const QString & getName () const =0
 
virtual const QString & getExternalId () const =0
 
virtual const QString & getDescription () const =0
 
virtual GKModelgetModel () const =0
 
virtual QVariant * getDataValue (const GKColumn *attr, bool *deleteit, const GKContext &context=GKContext::anyContext) const =0
 
virtual QVariant * getDataValueByID (uint attrId, bool *deleteit, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueInTS (const GKColumn *attr, GKTimeSerieIndex index, double *deviation=NULL) const =0
 
virtual double getDataValueInTSByID (uint attrId, GKTimeSerieIndex index, double *deviation=NULL) const =0
 
virtual GKTimeSeriegetDataValueTS (const GKColumn *attr) const =0
 
virtual GKTimeSeriegetDataValueTSByID (uint attrId) const =0
 
virtual int getDataValueInt (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual int getDataValueIntByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueDouble (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual double getDataValueDoubleByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QString getDataValueString (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QString getDataValueStringByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual bool getDataValueBool (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual bool getDataValueBoolByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKObjectgetDataValueObject (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKObjectgetDataValueObjectByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDate getDataValueDate (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDate getDataValueDateByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QTime getDataValueTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QTime getDataValueTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDateTime getDataValueDateTime (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual QDateTime getDataValueDateTimeByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKTimeDuration getDataValueTimeDuration (const GKColumn *attr, const GKContext &context=GKContext::anyContext) const =0
 
virtual GKTimeDuration getDataValueTimeDurationByID (uint attrId, const GKContext &context=GKContext::anyContext) const =0
 

Additional Inherited Members

- Public Attributes inherited from GKBaseObject
ConvertToSubClassCode Py_BEGIN_ALLOW_THREADS GKBaseObjectbase = (GKBaseObject*)sipCpp
 
 sipType = 0
 
- Static Public Attributes inherited from GKGeoObject
static uint markAtt
 
static uint altitudeAtt
 
static uint numberOfConnectionsAtt
 
static uint layerAtt
 
- Static Public Attributes inherited from GKObject
static uint typeNameAtt
 
static uint typeExternalNameAtt
 
static uint revisedAtt
 
- Static Public Attributes inherited from GKBaseObject
Py_END_ALLOW_THREADS static End uint idAtt
 
static uint nameAtt
 
static uint externalIdAtt
 
static uint descriptionAtt
 

Detailed Description

This class holds a set of consecutive, connected, segments. Each segment can be either a bezier curve or a straight segment. Its possible to mix these two types of segments.

Besides a straight segment, it support two types of curves:

Member Enumeration Documentation

◆ GKBezierCurveType

Enumerator
eSegment 
eSimpleCurve 
eCurve 

Constructor & Destructor Documentation

◆ GKBezierCurve()

GKBezierCurve::GKBezierCurve ( )

Member Function Documentation

◆ addCurvePointAt()

virtual void GKBezierCurve::addCurvePointAt ( int  pos,
const GKPoint p 
)
virtual

At a point at position pos. This will convert a segment in a simple curve and a simple curve in a complex curve. In a complex curve a line segment will be create for this new point.

◆ addSegment()

void GKBezierCurve::addSegment ( GKBezierCurveType  type)

Add a new segment. This call do not add any new point so it will be called always with methods that adds points.

◆ angleToCurve()

GKCoord GKBezierCurve::angleToCurve ( const GKBezierCurve curve) const

This function returns the angle in radians (-GKPI, GKPI] between the last part of this bezier curve and the first part of the 'curve' given as parameter of the function. If it is necessary it calculates the polyline of both bezier curves. The convention followed is: the angle is positive if from the first line to the second one the direction is counterclockwise. If the lines are parallel lines and going in the same direction it returns 0.0

◆ calculateBezierDerivative()

GKVector GKBezierCurve::calculateBezierDerivative ( float  t) const

Computes the derivative of a Bezier section using the value of the parametrized variable

◆ calculateBezierPoint()

GKPoint GKBezierCurve::calculateBezierPoint ( float  t) const

Computes the point of a Bezier section using the value of the parametrized variable

◆ calculateBezierRadius()

GKCoord GKBezierCurve::calculateBezierRadius ( const GKPoints p,
uint  nbpoints = 0 
) const

Calculates the mean radius of a bezier section. Note that it discretizes the curve so it it's an approximation and not the real minimum radius. if nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

◆ calculateBezierSecondDerivative()

GKVector GKBezierCurve::calculateBezierSecondDerivative ( float  t) const

Computes the second derivative of a Bezier section using the value of the parametrized variable

◆ calculatePolyline()

GKPoints GKBezierCurve::calculatePolyline ( uint  nbpoints = 0,
bool  simplify = true,
QVector< int > *  segmentsBeginPos = NULL 
) const

Calculates a polyline that represents a this GKBezierCurve. The polyline is calculated in "points" and "points" is also returned.

if nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

◆ canPointBeAdded()

virtual bool GKBezierCurve::canPointBeAdded ( uint  pos) const
virtual

Can a new point at position "pos" be added?

Reimplemented from GKPolyline.

Reimplemented in GKTurning.

◆ changeDirection()

virtual void GKBezierCurve::changeDirection ( )
virtual

See GKPolyline::changeDirection()

Reimplemented from GKPolyline.

Reimplemented in GKSection.

◆ getAltitude()

virtual GKCoord GKBezierCurve::getAltitude ( ) const
virtual

Get the altitude of this object (the minimum Z among all the possible Z of the object)

Reimplemented from GKGeoObject.

◆ getBezierRadiusatPoint()

GKCoord GKBezierCurve::getBezierRadiusatPoint ( const GKPoints p,
const GKPoint p1,
uint  nbpoints = 0 
) const

◆ getCurveType()

GKBezierCurveType GKBezierCurve::getCurveType ( uint  pos) const

Returns the curve type of the point at the specified pos.

◆ getNbSegments()

uint GKBezierCurve::getNbSegments ( ) const

Return the number of segments. Equivalent to:

getSegments().size();
See also
getSegments()

◆ getNumSegmentControlPoints()

int GKBezierCurve::getNumSegmentControlPoints ( int  pos) const

Returns the number of control points for one and only one of the segments of this curve

◆ getSegment()

GKBezierCurve GKBezierCurve::getSegment ( uint  pos) const

Retuns a curve for one and only one of the segments of this curve

◆ getSegmentLength()

GKCoord GKBezierCurve::getSegmentLength ( uint  pos,
uint  nbpoints = 0 
) const

Returns the length of the segment at "pos". It will use nbpoints points to evaluate the segment if it is a curve.

if nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

◆ hit()

bool GKBezierCurve::hit ( const GKPoint p,
float  epsilon 
) const

Hit: is p over the curve?

◆ isASegment()

bool GKBezierCurve::isASegment ( ) const

Return true is this object is a segment (it has a single segment and it is of type: eSegment)

◆ join()

virtual void GKBezierCurve::join ( const GKPolyline pol,
bool  atStart 
)
virtual

Add "pol" information to this curve either at the beginning (atStart = true) or at the end (atStart = false). Note that pol will not be moified and/or removed.

If pol is a curve both curves (pol and this) will be joined. The union between the two will try to share a segment (moving up the curve "order": from segment to simple curve, from simple curve to complex curve). If it is not possible a new segment (type segment will be added).

If pol is a polyline it will be added to the curve as new segment points (no curve).

Reimplemented from GKPolyline.

Reimplemented in GKSection.

◆ length2D()

GKCoord GKBezierCurve::length2D ( uint  nbpoints = 0) const

Length of this curve in 2D. Note that it first converts the curve to a polyline so it it's an approximation and not the real length. It will use "nbpoints" points to evaluate the curve.

if nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

◆ length3D()

GKCoord GKBezierCurve::length3D ( uint  nbpoints = 0) const

Length of this curve. Note that it first converts the curve to a polyline so it it's an approximation and not the real length. It will use "nbpoints" points to evaluate the curve.

if nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

◆ MeanRadius()

GKCoord GKBezierCurve::MeanRadius ( uint  nbpoints = 0) const

Mean radius of this curve. Note that it uses discretization of the curve so it it's an approximation and not the real mean radius. It will use "nbpoints" points to evaluate the curve. If nbpoints is 0 then the value of GKPoints::gkDefaultBezierPoints will be used.

◆ nbParts()

uint GKBezierCurve::nbParts ( ) const

◆ onlyContainsSegments()

bool GKBezierCurve::onlyContainsSegments ( ) const

Return true is this object only contains segments

◆ pointAtPos()

GKPoint GKBezierCurve::pointAtPos ( float  pos) const

Return the point in the center line at position "pos" relative to the start of the curve (pos = 0.0 is the start point, pos = length2D() is the end point.

◆ posAtPoint()

float GKBezierCurve::posAtPoint ( const GKPoint p,
GKCoord  maxDistToCurve = 0.01 
) const

Return the position in the center line at point "p". The point can be outside of the center line and, if so, the method will calculate the point at the more close segment (perpendicular to p) and will use this new point.

◆ removePoint()

virtual void GKBezierCurve::removePoint ( uint  pos)
virtual

Removes a point from the curve. This will simplify the curve (4 points curve to 3 points curve, 3 points curve to a segment, if it is a segment it will be removed).

Reimplemented from GKPolyline.

Reimplemented in GKSection.

◆ removePoints()

virtual void GKBezierCurve::removePoints ( uint  nbPoints,
bool  atStart,
int &  nbSegmentsRemoved 
)
virtual

Removes nbPoints from this curve either at the beginning (atStart = true) or at the end (atStart = false). The segments associated with these points will be removed too. It returns the number of segments removed in nbSegmentsRemoved.

◆ segmentAtPos()

int GKBezierCurve::segmentAtPos ( GKCoord  pos,
double *  length = NULL 
) const

Return the segment in the center line at position "pos" relative to the start of the section (pos = 0.0 is the start point, pos = length2D() is the end point). The length of the 0 --> pos - 1 segments is returned too if "length" is not None.

◆ segmentAtPosComplete()

int GKBezierCurve::segmentAtPosComplete ( const GKPoints points,
GKCoord  pos,
double *  retLength = NULL 
) const

Evaluates all the segments calculating their subsegments (if needed).

When a segment is eSegment the number subsegments is one. When a segment is eCurve or eSimpleCurve it is converted into GKPoints::gkDefaultBezierPoints subsegments.

Returns the subsegment in the center line at position "pos" relative to the start of the section (pos = 0.0 is the start point, pos = length2D() is the end point). The length of the 0 --> pos - 1 subSegments is returned too if "retLength" is not None.

◆ setAltitude()

virtual void GKBezierCurve::setAltitude ( GKCoord  value)
virtual

Sets the altitude of the bezier curve.

Reimplemented from GKGeoObject.

◆ setCurve()

void GKBezierCurve::setCurve ( const GKBezierCurve curve)

Copies a curve geometry on this curve.

◆ setFromPoints()

void GKBezierCurve::setFromPoints ( const GKPoints ps,
GKBezierCurveType  type 
)

Create a curve geometry from a polyline.

◆ setFromSegment()

void GKBezierCurve::setFromSegment ( const GKPoint p1,
const GKPoint p2,
GKBezierCurveType  type 
)

Create a curve geometry from two points.

◆ setPoint() [1/2]

void GKBezierCurve::setPoint ( int  i,
const GKPoint p 
)

◆ setPoint() [2/2]

void GKBezierCurve::setPoint ( int  s,
int  i,
const GKPoint p 
)

Sets p as the i-th point of segment s. Segments are numbered from 0 to n-1. i can be 0 or 1 for straight segments; 0, 1 or 2 for simple curve segments and 0,1, 2 or 3 for cruve with two control points. The last point of one segment is the first point of the next segment so the last of these two points set will override the previous point if defined previously

© Aimsun SLU
Aimsun ®