#3724 Added cycling default color to polyline import. Set default line thickness to 2.

Refactored away unneccesary complexity. loadAndUpdate when opening project file. Toggle now working
This commit is contained in:
Jacob Støren
2018-11-27 17:53:56 +01:00
parent d138770a2a
commit 29e6e08779
11 changed files with 114 additions and 138 deletions

View File

@@ -44,7 +44,7 @@ class RigPolyLinesData;
///
///
//==================================================================================================
class RimPolylinesAnnotation : public RimLineBasedAnnotation// caf::PdmObject
class RimPolylinesAnnotation : public RimLineBasedAnnotation
{
using Vec3d = cvf::Vec3d;
@@ -54,14 +54,15 @@ public:
RimPolylinesAnnotation();
~RimPolylinesAnnotation();
bool isActive();
virtual cvf::ref<RigPolyLinesData> polyLinesData() = 0;
virtual bool isEmpty() = 0;
protected:
virtual caf::PdmFieldHandle* objectToggleField() override;
private:
caf::PdmField<std::vector<Vec3d>> m_points;
caf::PdmField<bool> m_isActive;
};
@@ -104,14 +105,12 @@ public:
~RimPolylinesFromFileAnnotation();
void setFileName(const QString& fileName);
const QString& fileName();
QString fileName() const;
void readPolyLinesFile(QString * errorMessage);
cvf::ref<RigPolyLinesData> polyLinesData() override { return m_polyLinesData;}
virtual bool isEmpty() override;
void updateFilePathsFromProjectPath(const QString& newProjectPath, const QString& oldProjectPath);
void setDescriptionFromFileName();
protected:
@@ -122,7 +121,7 @@ private:
virtual caf::PdmFieldHandle* userDescriptionField() override;
caf::PdmField<QString> m_userDescription;
caf::PdmField<QString> m_polyLinesFileName;
caf::PdmField<caf::FilePath> m_polyLinesFileName;
cvf::ref<RigPolyLinesData> m_polyLinesData;
};