Switch to template types for vectors
This commit is contained in:
parent
9f036d6438
commit
8192ef78e8
105 changed files with 1614 additions and 1424 deletions
|
@ -20,7 +20,7 @@ PolygonNode::Type PolygonNode::getType()
|
|||
return Type::Polygon;
|
||||
}
|
||||
|
||||
void PolygonNode::setPoints(const std::vector<Point>& points)
|
||||
void PolygonNode::setPoints(const std::vector<Point2>& points)
|
||||
{
|
||||
mPoints = points;
|
||||
mGeometryIsDirty = true;
|
||||
|
@ -28,26 +28,15 @@ void PolygonNode::setPoints(const std::vector<Point>& points)
|
|||
|
||||
void PolygonNode::createOrUpdateGeometry(SceneInfo* sceneInfo)
|
||||
{
|
||||
auto polygon = std::make_unique<Polygon2>(mPoints);
|
||||
|
||||
if (!mBackgroundItem)
|
||||
{
|
||||
if (sceneInfo->mSupportsGeometryPrimitives)
|
||||
{
|
||||
auto polygon = std::make_unique<ntk::Polygon>(mPoints);
|
||||
mBackgroundItem = std::make_unique<SceneModel>(std::move(polygon));
|
||||
}
|
||||
else
|
||||
{
|
||||
//auto mesh = MeshPrimitives::buildRectangleAsTriMesh();
|
||||
//mBackgroundItem = std::make_unique<SceneModel>(std::move(mesh));
|
||||
}
|
||||
mBackgroundItem = std::make_unique<SceneModel>(std::move(polygon));
|
||||
mBackgroundItem->setName(mName + "_Model");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sceneInfo->mSupportsGeometryPrimitives)
|
||||
{
|
||||
auto polygon = std::make_unique<ntk::Polygon>(mPoints);
|
||||
mBackgroundItem->updateGeometry(std::move(polygon));
|
||||
}
|
||||
mBackgroundItem->updateGeometry(std::move(polygon));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue