feat: only render solo points
This commit is contained in:
@@ -30,7 +30,10 @@ geo::Geometry::Geometry(const Geometry& other):
|
||||
vertexCountHandlePrim_{enzo::ga::AttributeHandleInt(getAttribByName(ga::AttrOwner::PRIMITIVE, "vertexCount"))},
|
||||
closedHandlePrim_{enzo::ga::AttributeHandleBool(getAttribByName(ga::AttrOwner::PRIMITIVE, "closed"))},
|
||||
pointOffsetHandleVert_{enzo::ga::AttributeHandleInt(getAttribByName(ga::AttrOwner::VERTEX, "point"))},
|
||||
posHandlePoint_{enzo::ga::AttributeHandleVector3(getAttribByName(ga::AttrOwner::POINT, "P"))}
|
||||
posHandlePoint_{enzo::ga::AttributeHandleVector3(getAttribByName(ga::AttrOwner::POINT, "P"))},
|
||||
|
||||
// other
|
||||
soloPoints_{other.soloPoints_}
|
||||
{
|
||||
|
||||
}
|
||||
@@ -40,6 +43,7 @@ void geo::Geometry::addFace(std::vector<ga::Offset> pointOffsets, bool closed)
|
||||
for(ga::Offset pointOffset : pointOffsets)
|
||||
{
|
||||
pointOffsetHandleVert_.addValue(pointOffset);
|
||||
soloPoints_.erase(pointOffset);
|
||||
}
|
||||
vertexCountHandlePrim_.addValue(pointOffsets.size());
|
||||
closedHandlePrim_.addValue(closed);
|
||||
@@ -49,10 +53,29 @@ void geo::Geometry::addFace(std::vector<ga::Offset> pointOffsets, bool closed)
|
||||
void geo::Geometry::addPoint(const bt::Vector3& pos)
|
||||
{
|
||||
posHandlePoint_.addValue(pos);
|
||||
soloPoints_.emplace(posHandlePoint_.getSize()-1);
|
||||
}
|
||||
|
||||
ga::Offset geo::Geometry::getNumSoloPoints() const
|
||||
{
|
||||
return soloPoints_.size();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::set<ga::Offset>::const_iterator geo::Geometry::soloPointsBegin()
|
||||
{
|
||||
return soloPoints_.begin();
|
||||
}
|
||||
|
||||
std::set<ga::Offset>::const_iterator geo::Geometry::soloPointsEnd()
|
||||
{
|
||||
return soloPoints_.end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bt::Vector3 geo::Geometry::getPosFromVert(ga::Offset vertexOffset) const
|
||||
{
|
||||
// get point offset
|
||||
|
||||
@@ -34,6 +34,9 @@ public:
|
||||
void addFace(std::vector<ga::Offset> pointOffsets, bool closed=true);
|
||||
void addPoint(const bt::Vector3& pos);
|
||||
|
||||
std::set<ga::Offset>::const_iterator soloPointsBegin();
|
||||
std::set<ga::Offset>::const_iterator soloPointsEnd();
|
||||
|
||||
void setPointPos(const ga::Offset offset, const bt::Vector3& pos);
|
||||
|
||||
ga::Offset getPrimStartVertex(ga::Offset primOffset) const; // returns the first vertex of the primitive
|
||||
@@ -43,6 +46,7 @@ public:
|
||||
ga::Offset getNumPrims() const;
|
||||
ga::Offset getNumVerts() const;
|
||||
ga::Offset getNumPoints() const;
|
||||
ga::Offset getNumSoloPoints() const;
|
||||
|
||||
bt::boolT isClosed(ga::Offset primOffset) const;
|
||||
|
||||
@@ -58,6 +62,8 @@ private:
|
||||
attribVector primitiveAttributes_;
|
||||
attribVector globalAttributes_;
|
||||
|
||||
std::set<ga::Offset> soloPoints_;
|
||||
|
||||
std::vector<ga::Offset> primStarts_;
|
||||
|
||||
// handles
|
||||
|
||||
Reference in New Issue
Block a user