SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Protected Attributes | List of all members
smtk::session::polygon::internal::pmodel Class Reference
Inheritance diagram for smtk::session::polygon::internal::pmodel:
[legend]
Collaboration diagram for smtk::session::polygon::internal::pmodel:
[legend]

Public Member Functions

 smtkTypeMacro (pmodel)
 
 smtkCreateMacro (pmodel)
 
 smtkSharedFromThisMacro (entity)
 
bool computeModelScaleAndNormal (std::vector< double > &origin, std::vector< double > &x_axis, std::vector< double > &y_axis, double featureSize, smtk::io::Logger &log)
 
bool computeModelScaleAndYAxis (std::vector< double > &origin, std::vector< double > &x_axis, std::vector< double > &z_axis, double featureSize, smtk::io::Logger &log)
 
bool computeFeatureSizeAndNormal (std::vector< double > &origin, std::vector< double > &x_axis, std::vector< double > &y_axis, long long modelScale, smtk::io::Logger &log)
 
bool restoreModel (std::vector< double > &origin, std::vector< double > &x_axis, std::vector< double > &y_axis, std::vector< double > &z_axis, std::vector< double > &i_axis, std::vector< double > &j_axis, double featureSize, long long modelScale)
 
smtk::model::Vertices findOrAddModelVertices (smtk::model::ResourcePtr resource, const std::vector< double > &points, int numCoordsPerPt)
 
smtk::model::Vertex findOrAddModelVertex (smtk::model::ResourcePtr resource, const Point &pt, bool addToModel=true)
 Add a vertex to the model resource. More...
 
smtk::model::Vertex addModelVertex (smtk::model::ResourcePtr resource, const Point &pt, bool addToModel=true)
 
bool demoteModelVertex (smtk::model::ResourcePtr resource, internal::VertexPtr vert, smtk::model::EntityRefs &created, smtk::model::EntityRefs &modified, smtk::model::EntityRefs &expunged, int debugLevel=0)
 Demote a model vertex. More...
 
model::Edge createModelEdgeFromVertices (smtk::model::ResourcePtr resource, internal::VertexPtr v0, internal::VertexPtr v1)
 Create a model edge from 2 model vertices. More...
 
template<typename T , typename U >
model::Edge createModelEdgeFromSegments (smtk::model::ResourcePtr resource, T begin, T end, bool addToModel, const U &splitEdgeFaces, bool headIsNewVertex, smtk::model::VertexSet &newVerts)
 
template<typename T >
model::Edge createModelEdgeFromPoints (smtk::model::ResourcePtr resource, T begin, T end, bool isFreeCell)
 
template<typename T >
std::set< IdcreateModelEdgesFromPoints (T begin, T end)
 
bool splitModelEdgeAtPoint (smtk::model::ResourcePtr resource, const Id &edgeId, const std::vector< double > &point, smtk::model::EntityRefArray &created, int debugLevel=0)
 Split the model edge with the given edgeId at the given coords. More...
 
bool splitModelEdgeAtIndex (smtk::model::ResourcePtr resource, const Id &edgeId, int splitPointIndex, smtk::model::EntityRefArray &created, int debugLevel=0)
 Split the model edge with the given edgeId at the given pointIndex. More...
 
bool splitModelEdgeAtModelVertex (smtk::model::ResourcePtr resource, const Id &edgeId, const Id &vertexId, smtk::model::EntityRefArray &created, int debugLevel=0)
 Split the model edge at one of its points that has been promoted to a model vertex. More...
 
bool splitModelEdgeAtModelVertex (smtk::model::ResourcePtr resource, EdgePtr edgeToSplit, VertexPtr splitPoint, PointSeq::const_iterator location, smtk::model::EntityRefArray &created, int debugLevel=0)
 
bool splitModelEdgeAtModelVertices (smtk::model::ResourcePtr resource, EdgePtr edgeToSplit, std::vector< VertexPtr > &splitPoints, std::vector< PointSeq::const_iterator > &locations, smtk::model::EntityRefArray &created, int debugLevel=0)
 
std::pair< Id, IdremoveModelEdgeFromEndpoints (smtk::model::ResourcePtr resource, EdgePtr edg)
 
bool removeVertexLookup (const internal::Point &location, const Id &vid)
 Remove a reverse lookup (from coordinates to vertex ID) from the model's search structure.
 
Point edgeTestPoint (const Id &edgeId, bool edgeEndPt) const
 Return the point closest to one of an edge's endpoints. More...
 
void pointsInLoopOrder (std::vector< Point > &pts, const smtk::model::Loop &loop)
 
void addFaceTessellation (smtk::model::Face &faceRec)
 
void addEdgeTessellation (smtk::model::Edge &edgeRec, internal::EdgePtr edgeData)
 
void addVertTessellation (smtk::model::Vertex &vertRec, internal::VertexPtr vertData)
 
void addFaceMeshTessellation (smtk::model::Face &faceRec)
 
void addEdgeMeshTessellation (smtk::model::Edge &edgeRec, internal::EdgePtr edgeData)
 
void addVertMeshTessellation (smtk::model::Vertex &vertRec, internal::VertexPtr vertData)
 
double * origin ()
 
const double * origin () const
 
double * xAxis ()
 
const double * xAxis () const
 
double * yAxis ()
 
const double * yAxis () const
 
double * zAxis ()
 
const double * zAxis () const
 
double * iAxis ()
 
const double * iAxis () const
 
double * jAxis ()
 
const double * jAxis () const
 
double featureSize () const
 
double modelScale () const
 
SessionPtr session ()
 
void setSession (SessionPtr s)
 
Id pointId (const Point &p) const
 
smtk::model::Vertex vertexAtPoint (smtk::model::ResourcePtr resource, const Point &p) const
 A convenience method to get the model vertex at p. More...
 
template<typename T >
Point projectPoint (T coordBegin, T coordEnd)
 
template<typename T >
void liftPoint (const Point &ix, T coordBegin)
 
template<typename T >
bool tweakEdge (smtk::model::Edge edge, int numCoordsPerPt, T coordBegin, T coordEnd, smtk::model::EntityRefArray &modified)
 
bool tweakEdge (smtk::model::Edge edge, internal::PointSeq &replacement, smtk::model::EntityRefArray &modified)
 Tweak an edge into a new shape, which you promise is valid. More...
 
bool tweakVertex (smtk::model::Vertex vertRec, const Point &vertPosn, smtk::model::EntityRefs &modifiedEdgesAndFaces)
 Move the model vertex vertRec from its current location to vertPosn. More...
 
void addVertexIndex (VertexPtr vert)
 
- Public Member Functions inherited from smtk::session::polygon::internal::entity
 smtkTypeMacroBase (entity)
 
Id id () const
 
void setId (const Id &i)
 
entityparent () const
 
void setParent (entity *p)
 
template<typename T >
T * parentAs () const
 

Protected Attributes

SessionPtr m_session
 
long long m_scale
 
double m_featureSize { 1e-8 }
 
double m_origin [3]
 
double m_xAxis [3]
 
double m_yAxis [3]
 
double m_zAxis [3]
 
double m_iAxis [3]
 
double m_jAxis [3]
 
PointToVertexId m_vertices
 
- Protected Attributes inherited from smtk::session::polygon::internal::entity
entitym_parent { nullptr }
 
Id m_id
 

Additional Inherited Members

- Protected Member Functions inherited from smtk::session::polygon::internal::entity
 entity (const Id &uid, entity *p)
 

Member Function Documentation

◆ createModelEdgeFromVertices()

model::Edge smtk::session::polygon::internal::pmodel::createModelEdgeFromVertices ( smtk::model::ResourcePtr  resource,
internal::VertexPtr  v0,
internal::VertexPtr  v1 
)

Create a model edge from 2 model vertices.

The model vertices should be different.

If these preconditions do not hold, either an invalid (empty) edge will be returned or the model will become inconsistent.

◆ demoteModelVertex()

bool smtk::session::polygon::internal::pmodel::demoteModelVertex ( smtk::model::ResourcePtr  resource,
internal::VertexPtr  vert,
smtk::model::EntityRefs created,
smtk::model::EntityRefs modified,
smtk::model::EntityRefs expunged,
int  debugLevel = 0 
)

Demote a model vertex.

Returns true when the vertex is deleted and false otherwise (because exactly 1 or more than 2 edge-incidences were present).

◆ edgeTestPoint()

Point smtk::session::polygon::internal::pmodel::edgeTestPoint ( const Id edgeId,
bool  edgeEndPt 
) const

Return the point closest to one of an edge's endpoints.

Returns the point nearest but not at the tail end of the edge (using the edge's forward ordering of points) when edgeEndPt is true. Returns the point nearest but not at the front end of the edge when edgeEndPt is false.

This method is used to order edges in the immediate neighborhood of model vertices (which may only be endpoints, not interior points).

◆ findOrAddModelVertex()

smtk::model::Vertex smtk::session::polygon::internal::pmodel::findOrAddModelVertex ( smtk::model::ResourcePtr  resource,
const Point &  pt,
bool  addToModel = true 
)

Add a vertex to the model resource.

This creates a vertex record in the model resource and adds its tessellation. It also adds the integer coordinates of the point to the internal model's data (this instance). This does not create a default name or relate the vertex record in the model resource to a parent model or owning geometric entity (such as an edge, face, or volume) unless addToModel is true, in which case the vertex is added as a free cell to the SMTK model.

◆ splitModelEdgeAtIndex()

bool smtk::session::polygon::internal::pmodel::splitModelEdgeAtIndex ( smtk::model::ResourcePtr  resource,
const Id edgeId,
int  pointIndex,
smtk::model::EntityRefArray created,
int  debugLevel = 0 
)

Split the model edge with the given edgeId at the given pointIndex.

If the point is already a model vertex, this method returns false.

New edge Ids and new vertex Id are added to the created array.

◆ splitModelEdgeAtModelVertex()

bool smtk::session::polygon::internal::pmodel::splitModelEdgeAtModelVertex ( smtk::model::ResourcePtr  resource,
const Id edgeId,
const Id vertexId,
smtk::model::EntityRefArray created,
int  debugLevel = 0 
)

Split the model edge at one of its points that has been promoted to a model vertex.

Since model edges are not allowed to have model vertices along their interior, this method should not be exposed as a public operator but may be used internally when performing other operations.

◆ splitModelEdgeAtPoint()

bool smtk::session::polygon::internal::pmodel::splitModelEdgeAtPoint ( smtk::model::ResourcePtr  resource,
const Id edgeId,
const std::vector< double > &  coords,
smtk::model::EntityRefArray created,
int  debugLevel = 0 
)

Split the model edge with the given edgeId at the given coords.

The point coordinates need not lie precisely on the edge, but are assumed not to cause the split edge to intersect (or miss) any faces or edges the original edge did not.

If the point coordinates already specify a model vertex, this method returns false.

FIXME: Return new edge Ids and new vertex Id.

◆ tweakEdge()

bool smtk::session::polygon::internal::pmodel::tweakEdge ( smtk::model::Edge  edge,
internal::PointSeq &  replacement,
smtk::model::EntityRefArray modified 
)

Tweak an edge into a new shape, which you promise is valid.

This variant accepts iterators for a list of point objects (not coordinates) in the internal coordinate system of the polygon. WARNING: The input replacement list is spliced into the edge, and thus all entries are removed from replacement. This is done so that iterators pointing into replacement are valid iterators into the resulting edge; this property is used by the "clean geometry" operator to efficiently reshape and split a model edge at intersection points.

If the first and last points are not precisely coincident with the original edge's, then any model vertices are tweaked as well. Faces attached to the edge are retessellated.

◆ tweakVertex()

bool smtk::session::polygon::internal::pmodel::tweakVertex ( smtk::model::Vertex  vertRec,
const Point &  vertPosn,
smtk::model::EntityRefs modifiedEdgesAndFaces 
)

Move the model vertex vertRec from its current location to vertPosn.

Note that this should not generally be allowed without a lot of checks to verify that the tweak results in a valid model. No checks are performed here.

◆ vertexAtPoint()

smtk::model::Vertex smtk::session::polygon::internal::pmodel::vertexAtPoint ( smtk::model::ResourcePtr  resource,
const Point &  p 
) const
inline

A convenience method to get the model vertex at p.

This method will never create a model vertex; if one is not present at p, an invalid model::Vertex will be returned.


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