SketcherGui::CoinMapping Struct Reference

Helper struct containing index conversions (mappings) between {GeoId, PointPos} and MF indices per layer, and VertexId and MF indices per layer. More...

#include <EditModeCoinManagerParameters.h>

Public Member Functions

void clear ()
 
int getCurveGeoId (int curveindex, int layerindex)
 given the MF index of a curve and the coin layer in which it is drawn returns the GeoId of the curve More...
 
MultiFieldId getIndexLayer (int geoid, Sketcher::PointPos pos)
 given the {GeoId, PointPos} of a curve or point, returns MultiFieldId containing the MF index and the coin layer of the curve or point More...
 
MultiFieldId getIndexLayer (int vertexId)
 given the VertexId of a point, returns MultiFieldId containing the MF index and the coin layer of the point More...
 
int getPointGeoId (int pointindex, int layerindex)
 given the MF index of a point and the coin layer in which it is drawn returns the GeoId of the point More...
 
int getPointVertexId (int pointindex, int layerindex)
 given the MF index of a point and the coin layer in which it is drawn returns the VertexId of the point More...
 

Public Attributes

std::vector< std::vector< int > > CurvIdToGeoId
 
std::map< Sketcher::GeoElementId, MultiFieldIdGeoElementId2SetId
 This maps GeoElementId index {GeoId, PointPos} to a {coin layer and MF index} of a curve or point. More...
 
std::vector< std::vector< int > > PointIdToGeoId
 
std::vector< std::vector< int > > PointIdToVertexId
 

Detailed Description

Helper struct containing index conversions (mappings) between {GeoId, PointPos} and MF indices per layer, and VertexId and MF indices per layer.

These are updated with every draw of the scenegraph.

Member Function Documentation

◆ clear()

void SketcherGui::CoinMapping::clear ( void  )

◆ getCurveGeoId()

int SketcherGui::CoinMapping::getCurveGeoId ( int  curveindex,
int  layerindex 
)

given the MF index of a curve and the coin layer in which it is drawn returns the GeoId of the curve

References CurvIdToGeoId.

Referenced by SketcherGui::EditModeCoinManager::detectPreselection(), and SketcherGui::EditModeGeometryCoinManager::updateGeometryColor().

◆ getIndexLayer() [1/2]

MultiFieldId SketcherGui::CoinMapping::getIndexLayer ( int  geoid,
Sketcher::PointPos  pos 
)

given the {GeoId, PointPos} of a curve or point, returns MultiFieldId containing the MF index and the coin layer of the curve or point

References GeoElementId2SetId, and SketcherGui::MultiFieldId::Invalid.

Referenced by SketcherGui::EditModeConstraintCoinManager::updateConstraintColor(), and SketcherGui::EditModeGeometryCoinManager::updateGeometryColor().

◆ getIndexLayer() [2/2]

MultiFieldId SketcherGui::CoinMapping::getIndexLayer ( int  vertexId)

given the VertexId of a point, returns MultiFieldId containing the MF index and the coin layer of the point

References DraftVecUtils::find(), SketcherGui::MultiFieldId::Invalid, and PointIdToVertexId.

◆ getPointGeoId()

int SketcherGui::CoinMapping::getPointGeoId ( int  pointindex,
int  layerindex 
)

given the MF index of a point and the coin layer in which it is drawn returns the GeoId of the point

References PointIdToGeoId.

Referenced by SketcherGui::EditModeGeometryCoinManager::updateGeometryColor().

◆ getPointVertexId()

int SketcherGui::CoinMapping::getPointVertexId ( int  pointindex,
int  layerindex 
)

given the MF index of a point and the coin layer in which it is drawn returns the VertexId of the point

References PointIdToVertexId.

Referenced by SketcherGui::EditModeCoinManager::detectPreselection().

Member Data Documentation

◆ CurvIdToGeoId

std::vector<std::vector<int> > SketcherGui::CoinMapping::CurvIdToGeoId

◆ GeoElementId2SetId

std::map<Sketcher::GeoElementId,MultiFieldId> SketcherGui::CoinMapping::GeoElementId2SetId

This maps GeoElementId index {GeoId, PointPos} to a {coin layer and MF index} of a curve or point.

Referenced by clear(), SketcherGui::EditModeGeometryCoinConverter::convert(), and getIndexLayer().

◆ PointIdToGeoId

std::vector<std::vector<int> > SketcherGui::CoinMapping::PointIdToGeoId

◆ PointIdToVertexId

std::vector<std::vector<int> > SketcherGui::CoinMapping::PointIdToVertexId

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