Switch to template types for vectors
This commit is contained in:
parent
9f036d6438
commit
8192ef78e8
105 changed files with 1614 additions and 1424 deletions
|
@ -34,9 +34,9 @@ void LineEndNode::createOrUpdateGeometry(SceneInfo*)
|
|||
if (mStyle == Style::CLOSED_ARROW)
|
||||
{
|
||||
auto polygon = std::make_unique<PolygonNode>();
|
||||
auto p0 = Point(0.0, -mSize / 2.0);
|
||||
auto p1 = Point(mSize, 0.0);
|
||||
auto p2 = Point(0.0, mSize / 2.0);
|
||||
auto p0 = Point2(0.0, -mSize / 2.0);
|
||||
auto p1 = Point2(mSize, 0.0);
|
||||
auto p2 = Point2(0.0, mSize / 2.0);
|
||||
polygon->setPoints({ p0, p1, p2 });
|
||||
polygon->setFillColor({ 0, 0, 0 });
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ private:
|
|||
|
||||
std::unique_ptr<GeometryNode> mContentNode;
|
||||
|
||||
Vector mDirection;
|
||||
Vector3 mDirection;
|
||||
|
||||
bool mContentDirty{ true };
|
||||
double mSize{ 5.0 };
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "SceneInfo.h"
|
||||
|
||||
#include "SceneModel.h"
|
||||
#include "PostscriptReader.h"
|
||||
|
||||
PathNode::PathNode(const Transform& transform, const std::string& psPath)
|
||||
: GeometryNode(transform),
|
||||
|
@ -34,23 +35,17 @@ void PathNode::setPathString(const std::string& psPath)
|
|||
|
||||
void PathNode::createOrUpdateGeometry(SceneInfo* sceneInfo)
|
||||
{
|
||||
auto path = std::make_unique<GeometryPath>();
|
||||
PostscriptReader reader;
|
||||
reader.read(path.get(), mPathString);
|
||||
|
||||
if (!mBackgroundItem)
|
||||
{
|
||||
if (sceneInfo->mSupportsGeometryPrimitives)
|
||||
{
|
||||
auto path = std::make_unique<GeometryPath>();
|
||||
path->buildFromPostscript(mPathString);
|
||||
mBackgroundItem = std::make_unique<SceneModel>(std::move(path));
|
||||
mBackgroundItem->setName(mName + "_Model");
|
||||
}
|
||||
mBackgroundItem = std::make_unique<SceneModel>(std::move(path));
|
||||
mBackgroundItem->setName(mName + "_Model");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sceneInfo->mSupportsGeometryPrimitives)
|
||||
{
|
||||
auto path = std::make_unique<GeometryPath>();
|
||||
path->buildFromPostscript(mPathString);
|
||||
mBackgroundItem->updateGeometry(std::move(path));
|
||||
}
|
||||
mBackgroundItem->updateGeometry(std::move(path));
|
||||
}
|
||||
}
|
|
@ -224,7 +224,7 @@ void TextNode::update(SceneInfo* sceneInfo)
|
|||
|
||||
if (mRenderNodeBounds)
|
||||
{
|
||||
auto rect = std::make_unique<ntk::Rectangle>(Point(0.0, 0.0), mWidth, mHeight);
|
||||
auto rect = std::make_unique<ntk::Rectangle>(mWidth, mHeight);
|
||||
mNodeBounds = std::make_unique<SceneModel>();
|
||||
mNodeBounds->updateGeometry(std::move(rect));
|
||||
|
||||
|
@ -235,7 +235,7 @@ void TextNode::update(SceneInfo* sceneInfo)
|
|||
|
||||
if (mRenderTextBounds)
|
||||
{
|
||||
auto rect = std::make_unique<ntk::Rectangle>(Point(0.0, 0.0), mContentWidth, mContentHeight);
|
||||
auto rect = std::make_unique<ntk::Rectangle>(mContentWidth, mContentHeight);
|
||||
mTextBounds = std::make_unique<SceneModel>();
|
||||
mTextBounds->updateGeometry(std::move(rect));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue