MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
CSO.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13
15
16#pragma once
17
18
19#include "MLCSOIncludes.h"
20
21#include "CSOAttributes.h"
22#include "CSOBase/CSOGroup.h"
26
27
29
30
31// Forward declaration.
32class CSOList;
33class CSOManager;
34
35
37
44{
45
46public:
48 CSO();
50 CSO(CSOList* csoList);
54 CSO(const CSO& cso, CSOList* csoList = nullptr, unsigned int csoId = INVALID_CSO_ID);
56 virtual ~CSO();
57
58
59 /* METHODS */
60
62
63
66
69 [[deprecated("Use reverseSeedPointOrder() instead.")]]
71 {
72 reverseSeedPointOrder();
73 }
74
76 inline void storeInUndoManager()
77 {
78 setInsertRemoveSeedPointCommand();
79 }
81
83
92 void moveSeedPointsAndPathPoints(const Vector3& offset, int timepoint);
95 void moveSeedPointsAndPathPoints(double dx, double dy, double dz, int timepoint);
99 void moveSeedPointsAndPathPoints(double dx, double dy, double dz);
100
102 void setAbsoluteMovementCommand(double fromX, double fromY, double fromZ, double toX, double toY, double toZ,
105 void moveSingleSeedPoint(CSOSeedPoint* sPoint, double dx, double dy, double dz);
111
120
128 void setSeedAndPathPoints(unsigned int numSeedPoints, bool isClosed = true);
130 void setInitialSeedAndPathPointsNoEvent(unsigned int numSeedPoints, bool isClosed = true);
148
154 CSOSeedPoint* getSeedPointAt(unsigned int index) const;
157 {
158 if (numSeedPoints()) {
159 return _seedPointList[0];
160 }
161 else {
162 return nullptr;
163 }
164 }
167 {
168 if (numSeedPoints()) {
169 return _seedPointList[numSeedPoints() - 1];
170 }
171 else {
172 return nullptr;
173 }
174 }
176 inline unsigned int numSeedPoints() const
177 {
178 return static_cast<unsigned int>(_seedPointList.size());
179 }
181 bool getSeedPointIndex(CSOSeedPoint* sPoint, unsigned int& index) const;
183 inline unsigned int numPathPointLists() const
184 {
185 return static_cast<unsigned int>(_pathPointsList.size());
186 }
188 void fillPathPointCoordinatesFlattened(std::vector<Vector3>& pathPointCoords) const;
193 inline CSOPathPoints* getPathPointsAt(unsigned int index) const
194 {
195 return _pathPointsList[index];
196 }
199 unsigned int getTotalNumPathPoints() const;
202 unsigned int getTotalNumUniquePathPoints() const;
203
206
208
210 bool isSelected() const;
211
221 void setSeedPointSelectedAt(unsigned int index);
227 unsigned int getNumSelectedSeedPoints() const;
229 CSOSeedPoint* getSelectedSeedPointAt(unsigned int index) const;
231
238 bool addToGroup(CSOGroup& group, bool useUndoRedo = true);
240 void removeFromGroup(CSOGroup& group, bool useUndoRedo = true);
242 bool isInGroup(const CSOGroup* group) const;
243 // Returns whether this CSO is in a same CSOGroup as the specified CSO.
244 bool isInSameGroupsAs(CSO* cso) const;
246 bool isInGroup(unsigned int groupId) const;
248 inline unsigned int numGroups() const
249 {
250 return static_cast<unsigned int>(_csoGroupIds.size());
251 }
253 CSOGroup* getGroupAt(unsigned int index) const;
256 inline unsigned int getGroupIdAt(unsigned int index) const
257 {
258 return _csoGroupIds[index];
259 }
263
268 void _addReferenceToGroup(const CSOGroup& group);
272
278 inline void setType(const std::string& type)
279 {
280 _type = type;
281 }
283 inline const std::string& getType() const
284 {
285 return _type;
286 }
288 inline void setSubType(const std::string& subtype)
289 {
290 _subtype = subtype;
291 }
293 inline const std::string& getSubType() const
294 {
295 return _subtype;
296 }
298 inline void setCreatorId(int id)
299 {
300 _creatorId = id;
301 }
303 inline int getCreatorId() const
304 {
305 return _creatorId;
306 }
308
314 inline void setUserData(const std::string& name, Variant value)
315 {
316 _attributes.setUserData(name, value);
317 }
319 inline Variant getUserData(const std::string& name) const
320 {
321 return _attributes.getUserData(name);
322 }
324 inline void getUserDataNames(std::vector<std::string>& names) const
325 {
326 _attributes.getUserDataNames(names);
327 }
329 inline void removeUserData(const std::string& name)
330 {
331 _attributes.removeUserData(name);
332 }
334
342 CSOBoundingBox getVoxelBoundingBox(const Matrix4& worldToVoxelMatrix, size_t hashKey) const;
345 CSOBoundingBox getVoxelBoundingBoxSeedPoints(const Matrix4& worldToVoxelMatrix, size_t hashKey) const;
349 inline bool isInPlane() const
350 {
352 return isInPlane(dummy);
353 }
359 inline const Vector3& getPlaneNormal() const
360 {
361 _computeIsInPlane();
362 return _planeNormal;
363 }
365 inline void computePlaneNormal()
366 {
367 _computeIsInPlane();
368 }
372 inline void setIsInPlane(bool status)
373 {
374 _isInPlane = status;
375 }
378 {
379 _planeNormal = planeNormal;
380 _hasValidPlaneStatus = true;
381 }
384 {
385 _hasValidPlaneStatus = false;
386 }
388 double getLength() const;
390 inline double getArea() const
391 {
392 _computeArea();
393 return _area;
394 }
396 inline void invalidateArea()
397 {
398 _hasValidArea = false;
399 }
401 bool isSelfIntersecting() const;
407 void setIsClosed(bool isClosed);
409 inline bool isClosed() const
410 {
411 return _isClosed;
412 }
414 bool isPoint() const;
416 bool isEmpty() const;
419 inline void setIsFinished(bool isFinished)
420 {
421 _isFinished = isFinished;
422 }
424 inline bool getIsFinished() const
425 {
426 return _isFinished;
427 }
430 {
431 _needsInterpolation = needsInterpolation;
432 }
434 inline bool getNeedsInterpolation() const
435 {
436 return _needsInterpolation;
437 }
445 {
446 if (seedPoint != nullptr) {
447 seedPoint->setNeedsInterpolation(true);
448 _needsInterpolation = true;
449 }
450 }
454
462 void setCSOList(CSOList* csoList);
464 inline CSOList* getCSOList() const
465 {
466 return _csoList;
467 }
469 inline unsigned int getId() const
470 {
471 return _uniqueId;
472 }
474
480 void setLabel(const std::string& label);
482 inline const std::string& getLabel() const
483 {
484 return _attributes.label;
485 }
487 void setDescription(std::string description);
489 inline const std::string& getDescription() const
490 {
491 return _attributes.description;
492 }
493
497 int getTimePointIndex() const;
499 void setShowState(bool state);
501 bool getShowState() const;
503 void setVoxelizeState(bool state);
505 bool getVoxelizeState() const;
507 void setEditableState(bool state);
509 bool getEditableState() const;
513 inline void setPathPointStyle(int style)
514 {
515 setPathPointStyle(static_cast<CSOPathPointsStyle>(style));
516 }
520 void setPathPointWidth(float width);
522 float getPathPointWidth() const;
524 void setPathPointColor(const Vector3& color);
528 void setPathPointAlpha(float alpha);
530 float getPathPointAlpha() const;
534 int getSeedPointStyle() const;
536 void setSeedPointSize(float size);
538 float getSeedPointSize() const;
540 void setSeedPointColor(const Vector3& color);
544 void setSeedPointAlpha(float alpha);
546 float getSeedPointAlpha() const;
547
549 void setVoxelWriteMode(int mode);
551 int getVoxelWriteMode() const;
553 void setVoxelWriteValue(float value);
555 float getVoxelWriteValue() const;
556
558 void setAllValuesTo(float value);
560
566 inline int getPrivateTimePointIndex() const
567 {
568 return _attributes.timePointIndex;
569 }
571 inline bool getPrivateShowState() const
572 {
573 return _attributes.showState;
574 }
576 inline bool getPrivateVoxelizeState() const
577 {
578 return _attributes.voxelizeState;
579 }
581 inline bool getPrivateEditableState() const
582 {
583 return _attributes.editableState;
584 }
586 inline int getPrivatePathPointStyle() const
587 {
588 return _attributes.pathPointStyle;
589 }
591 inline float getPrivatePathPointWidth() const
592 {
593 return _attributes.pathPointWidth;
594 }
597 {
598 return _attributes.pathPointColor;
599 }
601 inline float getPrivatePathPointAlpha() const
602 {
603 return _attributes.pathPointAlpha;
604 }
606 inline int getPrivateSeedPointStyle() const
607 {
608 return _attributes.seedPointStyle;
609 }
611 inline float getPrivateSeedPointSize() const
612 {
613 return _attributes.seedPointSize;
614 }
617 {
618 return _attributes.seedPointColor;
619 }
621 inline float getPrivateSeedPointAlpha() const
622 {
623 return _attributes.seedPointAlpha;
624 }
625
627 inline int getPrivateVoxelWriteMode() const
628 {
629 return _attributes.voxelWriteMode;
630 }
632 inline float getPrivateVoxelWriteValue() const
633 {
634 return _attributes.voxelWriteValue;
635 }
636
637
640 {
641 _isFinished = isFinished;
642 }
645 {
646 _isClosed = isClosedP;
647 }
650 {
651 _isInPlane = isInPlaneP;
652 }
655 {
656 _worldBoundingBox = bb;
657 _hasValidWorldBoundingBox = true;
658 }
660 inline void setPrivatePlaneNormal(const Vector3& normal)
661 {
662 _planeNormal = normal;
663 _hasValidPlaneStatus = true;
664 }
667 void setId(unsigned int newId);
669
671 void setAttributesFrom(const CSO* const cso);
672
674 bool saveAttributes(std::ostream& outStream, bool useAscii = false);
675
677 void loadAttributes(std::istream& inStream, short version, bool swapBytes, bool useAscii = false);
678
681 {
682 return _attributes;
683 }
684
688 {
689 return _attributes;
690 }
691
692private:
696 template <class Method> int getOverrideGroupIndexForAttribute(Method method) const; // (defined in source file)
697
699 template <class T> void _fillPathPointCoordinatesFlattened(std::vector<T>& pathPointCoords) const;
700
701 /* MEMBER VARIABLES */
702
704 unsigned int _uniqueId;
705
707 std::vector<CSOSeedPoint*> _seedPointList;
709 std::vector<CSOPathPoints*> _pathPointsList;
710
711 friend class CSOList;
712
714 CSOList* _csoList{};
715
717 std::vector<unsigned int> _csoGroupIds;
718
720 std::vector<unsigned int> _selectedSeedPointsIndices;
721
723 std::string _type{"TYPE_NOT_SET"};
725 std::string _subtype{"SUB_TYPE_NOT_SET"};
727 int _creatorId{};
728
730 CSOAttributes _attributes;
731
733 mutable bool _hasValidWorldBoundingBox{};
735 mutable CSOBoundingBox _worldBoundingBox;
736
738 mutable boost::unordered_map<MatrixHashPair, CSOBoundingBox, MatrixHashFunction> _voxelBoundingBoxCache;
740 mutable boost::unordered_map<MatrixHashPair, CSOBoundingBox, MatrixHashFunction> _voxelSeedPointBoundingBoxCache;
741
743 mutable bool _hasValidPlaneStatus{};
745 mutable bool _hasValidArea{};
746
748 mutable bool _hasValidSelfIntersectingStatus{};
749
750
752 bool _isFinished{};
754 bool _isClosed{};
756 mutable bool _isInPlane{};
758 mutable Vector3 _planeNormal;
759
761 bool _needsInterpolation{};
762
764 mutable double _area{};
765
767 mutable bool _isSelfIntersecting{};
768
769
770 /* METHODS */
771
773 void _computeIsInPlane() const;
775 void _computeArea() const;
777 void _resetSeedPathLinks();
778};
779
781
const unsigned int INVALID_CSO_ID
Defines a CSO/CSOGroup ID that is invalid.
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Definition MLCSOSystem.h:23
This class comprises some attributes that are common for a CSO and a CSOGroup.
The CSOBoundingBox defines an axis-parallel bounding box with double precision.
A CSOGroup comprises a number of CSOs, which themselves can be in a number of different CSOGroups.
Definition CSOGroup.h:38
A CSOList comprises a number of CSOs and CSOGroups and is the central object for contour segmentation...
Definition CSOList.h:61
The CSOManager allows for storing and iterating CSOs, and implements an undo/redo mechanism.
Definition CSOManager.h:33
The CSOPathPoints is a list of world coordinates that are interpolated by a certain interpolation sch...
The CSOSeedPoint can be interactively set and modified, and is the framework for contours.
The CSO represents a contour segmentation object.
Definition CSO.h:44
void removeUserData(const std::string &name)
Removes a user data entry.
Definition CSO.h:329
CSOList * getCSOList() const
Returns the internal pointer to the embracing CSOList.
Definition CSO.h:464
bool getPrivateEditableState() const
Returns the private attribute 'editableState'.
Definition CSO.h:581
void invalidateArea()
Invalidates the internal area flag, so it can be recomputed.
Definition CSO.h:396
unsigned int numSeedPoints() const
Returns the number of seed points.
Definition CSO.h:176
CSOBoundingBox getVoxelBoundingBoxSeedPoints(const Matrix4 &worldToVoxelMatrix, size_t hashKey) const
Returns the bounding box of the seed points of this CSO in voxel coordinates computed by the specifie...
CSOPathPoints * appendPathPoints()
Appends just a path point list the internal list and returns a pointer to it.
void swapPoints(CSO &other)
Swaps the seed and path points of two CSOs. No events are emitted.
float getPathPointAlpha() const
Returns the alpha value of the path points.
bool isClosed() const
Returns whether the CSO is closed.
Definition CSO.h:409
void setDescription(std::string description)
Sets the description of this CSO.
const std::string & getDescription() const
Returns the description of this CSO.
Definition CSO.h:489
bool getEditableState() const
Returns the 'editable' state of this CSO.
CSOAttributes & getWritableAttributes()
Returns write access to all CSO attributes (NOTE: be careful as no events are emitted when changing t...
Definition CSO.h:687
void setSeedPointSize(float size)
Sets the size of the seed points.
float getPrivatePathPointWidth() const
Returns the private attribute 'path point width'.
Definition CSO.h:591
unsigned int numPathPointLists() const
Returns the number of path point lists.
Definition CSO.h:183
unsigned int numGroups() const
Returns the number of CSOGroups this CSO is in.
Definition CSO.h:248
CSOPathPointsStyle getPathPointStyle() const
Returns the style of the path points.
Vector3 getSeedPointColor() const
Returns the color of the seed points.
float getPrivateSeedPointAlpha() const
Returns the private attribute 'seed point alpha'.
Definition CSO.h:621
CSOSeedPoint * insertSeedPointAt(CSOPathPoints *toBeSplitPath, const Vector3 &toInsertPos)
Inserts a seed point into the specified toBeSplitPath at the specified position.
bool getIsFinished() const
Returns the finished status of this contour.
Definition CSO.h:424
const Vector3 & getPlaneNormal() const
Returns the plane normal. Only valid, if isInPlane returns 'true'.
Definition CSO.h:359
CSOSeedPoint * appendSeedAndPathPointNoEvent(const Vector3 &position)
Appends a seed point and a path point list to the end of the seed point list and returns a pointer to...
void applyTransformationMatrix(const Matrix4 &matrix)
const std::string & getLabel() const
Returns the label of this CSO.
Definition CSO.h:482
void setPrivateIsFinished(bool isFinished)
Sets the 'isFinished' flag without any side effects.
Definition CSO.h:639
CSOBoundingBox getVoxelBoundingBox(const Matrix4 &worldToVoxelMatrix, size_t hashKey) const
Returns the bounding box of this contour in voxel coordinates computed by the specified (image) matri...
void setNeedInterpolationAllSeedPoints(bool needsInterpolation)
Sets the need for interpolation to all member seed points.
void setSeedPointsAndPathPoints(const CSO *cso)
Sets the seed points and the path point of the specified CSO.
float getPathPointWidth() const
Returns the width of the path points.
float getVoxelWriteValue() const
Returns the voxel write value of this CSO.
CSOPathPoints * insertPathPointsEndStartNoEvent()
Inserts a CSOPathPoint list between the ending and the starting seed points and returns a pointer to ...
void setId(unsigned int newId)
Sets the unique ID of this CSO.
unsigned int getNumSelectedSeedPoints() const
Returns the number of selected seed points.
void setPrivatePlaneNormal(const Vector3 &normal)
Sets the plane normal of this CSO.
Definition CSO.h:660
CSOPathPoints * insertPathPointsEndStart()
Inserts a CSOPathPoint list between the ending and the starting seed points and returns a pointer to ...
float getSeedPointAlpha() const
Returns the alpha value of the seed points.
const std::string & getSubType() const
Returns the type of the CSO. This is set by the editor or processor that generated this CSO.
Definition CSO.h:293
void setVoxelWriteMode(int mode)
Sets the voxel write mode of this CSO.
bool isPoint() const
Returns whether the CSO is just a point.
void removeSeedPoint(CSOSeedPoint *sPoint)
Removes the specified seed point from this CSO.
void setLabel(const std::string &label)
void _removeReferenceToGroup(const CSOGroup &group)
Removes the specified CSOGroup from the internal list.
float getPrivatePathPointAlpha() const
Returns the private attribute 'path point alpha'.
Definition CSO.h:601
void clearSelectedSeedPoints()
Clears the list of selected seed points.
void setPrivateIsClosed(bool isClosedP)
Sets the 'isClosed' flag without any side effects.
Definition CSO.h:644
void resortSeedPointsClockwise()
Definition CSO.h:70
void getUserDataNames(std::vector< std::string > &names) const
Fills the specified vector with the keys/name under which user data is stored for this CSO.
Definition CSO.h:324
void setSeedPointColor(const Vector3 &color)
Sets the color of the seed points.
void setCreatorId(int id)
Sets the creator ID of the CSO. This is set by the editor or processor that generated this CSO.
Definition CSO.h:298
void moveSeedPointsAndPathPoints(const Vector3 &offset, int timepoint)
Moves all seed points and path points by the specified coordinate offset and sets the CSO to the spec...
bool getVoxelizeState() const
Returns the 'voxelize' state of this CSO.
Vector3 getPathPointColor() const
Returns the color of the path points.
bool isInSameGroupsAs(CSO *cso) const
void setUserData(const std::string &name, Variant value)
Definition CSO.h:314
int getTimePointIndex() const
Returns the time point index of this CSO.
void moveSeedPointsAndPathPoints(double dx, double dy, double dz, int timepoint)
Moves all seed points and path points by the specified coordinate offset and sets the CSO to the spec...
float getPrivateSeedPointSize() const
Returns the private attribute 'seed point size'.
Definition CSO.h:611
bool getSeedPointIndex(CSOSeedPoint *sPoint, unsigned int &index) const
Sets the sIndex to the index of the specified seed point and returns whether such a seed point exists...
int getCreatorId() const
Returns the creator ID of the CSO. This is set by the editor or processor that generated this CSO.
Definition CSO.h:303
bool isInPlane(Vector3 &planeNormal) const
Returns the plane status and fills the argument vector with the plane normal (only valid if all seed ...
unsigned int getTotalNumUniquePathPoints() const
Returns the total number of unique path points in this CSO; this number equals the number of path poi...
void setPrivateBoundingBox(const CSOBoundingBox &bb)
Sets the bounding box of this CSO.
Definition CSO.h:654
void setNeedInterpolation(CSOSeedPoint *seedPoint)
Sets the need of being interpolated to the specified seed point and to the CSO's state.
Definition CSO.h:444
int getPrivateSeedPointStyle() const
Returns the private attribute 'seed point style'.
Definition CSO.h:606
CSOSeedPoint * getLastSeedPoint() const
Returns a pointer to the last seed point of this CSO.
Definition CSO.h:166
CSOSeedPoint * appendSeedPoint()
Appends just a seed point to the internal list and returns a pointer to it.
bool isSelfIntersecting() const
Returns whether this CSO is self-intersecting.
CSO(const CSO &cso, CSOList *csoList=nullptr, unsigned int csoId=INVALID_CSO_ID)
Copy constructor; the unique ID is taken from the specified CSOList.
void setSeedAndPathPoints(unsigned int numSeedPoints, bool isClosed=true)
Generates the specified number of seed points and path point lists between those.
void setPathPointAlpha(float alpha)
Sets the alpha value of the path points.
void setPathPointStyle(CSOPathPointsStyle style)
Sets the style of the path points.
CSOGroup * getGroupAt(unsigned int index) const
Returns the CSOGroup at the specified index. If the index is out of bounds, nullptr is returned.
void setCSOList(CSOList *csoList)
unsigned int getId() const
Returns the unique ID of this CSO.
Definition CSO.h:469
void reverseSeedPointOrder()
Reverses the order of all seed points and clears all path points in between.
CSO()
Standard constructor. The unique ID is initialized with 0.
void storeInUndoManager()
Stores the geometric information of the CSO in the UndoRedo manager.
Definition CSO.h:76
void moveSingleSeedPoint(CSOSeedPoint *sPoint, double dx, double dy, double dz)
Moves a certain seed point by the specified coordinate offset.
int getPrivateTimePointIndex() const
Definition CSO.h:566
void removeFromGroup(CSOGroup &group, bool useUndoRedo=true)
Removes this CSO from the specified CSOGroup.
void setVoxelizeState(bool state)
Sets the 'voxelize' state of this CSO.
void moveSeedPointsAndPathPoints(const Vector3 &offset)
Moves all seed points and path points by the specified coordinate offset.
void setSeedPointStyle(int style)
Sets the style of the seed points.
bool getPrivateVoxelizeState() const
Returns the private attribute 'voxelizeState'.
Definition CSO.h:576
void removeAllSeedAndPathPoints()
Removes all seed points and path point lists from this CSO.
void fillPathPointCoordinatesFlattened(std::vector< Vector4 > &pathPointCoordsAndValues) const
Fills up the specified std::vector<Vector4> with all the path point coordinates and values in order.
CSOSeedPoint * getSelectedSeedPointAt(unsigned int index) const
Returns a pointer to a selected seed point at the specified index.
double getArea() const
Returns the area of this CSO (this value is only meaningful if all points lie in a plane).
Definition CSO.h:390
void setAbsoluteMovementCommand(double fromX, double fromY, double fromZ, double toX, double toY, double toZ, int fromTimePointIndex, int toTimePointIndex)
Sets the absolute movement for undo/redo.
bool isSelected() const
Returns whether this CSO is selected in its CSOList. If there is no enclosing CSOList,...
void invalidatePlaneNormal()
Invalidates the plane normal.
Definition CSO.h:383
Vector3 getPrivatePathPointColor() const
Returns the private attribute 'path point color'.
Definition CSO.h:596
Vector3 getPrivateSeedPointColor() const
Returns the private attribute 'seed point color'.
Definition CSO.h:616
void setPrivateIsInPlane(bool isInPlaneP)
Sets the 'isInPlane' flag without any side effects.
Definition CSO.h:649
void setInsertRemoveSeedPointCommand()
Triggers the according undo/redo command to be put on the stack.
bool isSelectedSeedPoint(CSOSeedPoint *sPoint) const
Returns whether the specified seed point is selected.
void _addReferenceToGroup(const CSOGroup &group)
void setIsFinished(bool isFinished)
Sets the finished status of this contour.
Definition CSO.h:419
void setNeedsInterpolation(bool needsInterpolation)
Sets whether this CSO needs interpolation.
Definition CSO.h:429
void setPathPointWidth(float width)
Sets the width of the path points.
CSOSeedPoint * appendSeedAndPathPoint()
Appends a seed point and a path point list to the end of the seed point list and returns a pointer to...
void setPlaneNormal(const Vector3 &planeNormal)
Sets the plane normal that becomes valid by this.
Definition CSO.h:377
void setSubType(const std::string &subtype)
Sets the subtype of the CSO. This is set by the editor or processor that generated this CSO.
Definition CSO.h:288
bool getShowState() const
Returns the 'show' status of this CSO.
void setIsInPlane(bool status)
Sets the plane normal status for this CSO.
Definition CSO.h:372
void computePlaneNormal()
Forces to recompute the plane normal (status).
Definition CSO.h:365
void storeVisualAttributesInUndoManager()
void setVoxelWriteValue(float value)
Sets the voxel write value of this CSO.
void removeFromAllGroups()
Removes this CSO from all its CSOGroups.
void setSeedPointSelectedAt(unsigned int index)
Sets the seed point at the specified index selected.
unsigned int getGroupIdAt(unsigned int index) const
Returns a CSOGroup ID at the specified index.
Definition CSO.h:256
bool isInPlane() const
Returns the plane status (do all seed points lie in a plane?).
Definition CSO.h:349
double getLength() const
Returns the length of this CSO (this is sum of the the euclidean distances between all successive pat...
void determineNeedsInterpolation()
Determines by investigating the CSO's seed points whether this CSO needs interpolation and sets this ...
void setEditableState(bool state)
Sets the 'editable' state of this CSO.
const std::string & getType() const
Returns the type of the CSO. This is set by the editor or processor that generated this CSO.
Definition CSO.h:283
bool saveAttributes(std::ostream &outStream, bool useAscii=false)
Save attributes to stream and returns whether the saving was successful.
int getPrivateVoxelWriteMode() const
Returns the private attribute 'voxelWriteMode'.
Definition CSO.h:627
CSOSeedPoint * getSeedPointAt(unsigned int index) const
int getVoxelWriteMode() const
Returns the voxel write mode of this CSO.
void fillPathPointCoordinatesFlattened(std::vector< Vector3 > &pathPointCoords) const
Fills up the specified std::vector<Vector3> with all the path point coordinates in order.
CSOManager * getManager() const
void setType(const std::string &type)
Definition CSO.h:278
void setSeedPointAlpha(float alpha)
Sets the alpha value of the seed points.
void setShowState(bool state)
Sets the 'show' status of this CSO.
void setPathPointStyle(int style)
Sets the style of the path points as an int.
Definition CSO.h:513
CSO(CSOList *csoList)
Constructor takes a pointer to the CSOList this CSO is in; in this method, the unique ID is set.
void setAllValuesTo(float value)
Sets all position values to the specified value.
bool getNeedsInterpolation() const
Returns whether this CSO needs interpolation.
Definition CSO.h:434
CSOSeedPoint * getFirstSeedPoint() const
Returns a pointer to the first seed point of this CSO.
Definition CSO.h:156
void loadAttributes(std::istream &inStream, short version, bool swapBytes, bool useAscii=false)
Loads attributes from stream.
unsigned int getTotalNumPathPoints() const
Returns the total number of path points in this CSO; this number may differ from the number of path p...
bool isInGroup(unsigned int groupId) const
Returns whether this CSO is in the CSOGroup with the specified ID.
void setAbsoluteSeedPointMovementCommand()
Sets the absolute movement of a single seed point for undo/redo.
float getSeedPointSize() const
Returns the size of the seed points.
void setIsClosed(bool isClosed)
Sets the closed state of this contour.
float getPrivateVoxelWriteValue() const
Returns the private attribute 'voxelWriteValue'.
Definition CSO.h:632
CSOSeedPoint * appendSeedAndPathPointNoEvent()
bool getPrivateShowState() const
Returns the private attribute 'showState'.
Definition CSO.h:571
void setSelectedSeedPoint(CSOSeedPoint *sPoint)
Sets the specified seed point as being selected, and deselects all previously selected seed points.
bool isInGroup(const CSOGroup *group) const
Returns whether this CSO is in the specified CSOGroup.
int getSeedPointStyle() const
Returns the style of the seed points.
CSOSeedPoint * appendSeedAndPathPoint(const Vector3 &position)
Appends a seed point and a path point list to the end of the seed point list and returns a pointer to...
void setAttributesFrom(const CSO *const cso)
Copies all attributes from the specified CSO to this one.
int getPrivatePathPointStyle() const
Returns the private attribute 'path point style'.
Definition CSO.h:586
CSOPathPoints * getPathPointsAt(unsigned int index) const
Returns the list of path points at a specified position.
Definition CSO.h:193
void setPathPointColor(const Vector3 &color)
Sets the color of the path points.
void addSelectedSeedPoint(CSOSeedPoint *sPoint)
bool isEmpty() const
Returns whether the CSO is empty; an empty CSO has neither seed points nor path points.
Variant getUserData(const std::string &name) const
Returns the user data associated with the specified name, or an invalid value if no such entry exists...
Definition CSO.h:319
bool addToGroup(CSOGroup &group, bool useUndoRedo=true)
const CSOBoundingBox & getWorldBoundingBox() const
void setInitialSeedAndPathPointsNoEvent(unsigned int numSeedPoints, bool isClosed=true)
Like setSeedAndPathPoints, but this method is faster because no events are emitted and no checks are ...
void pathChanged()
Sets any pre-computed values depending on the exact path to invalid.
void moveSeedPointsAndPathPoints(double dx, double dy, double dz)
Moves all seed points and path points by the specified coordinate offset.
void setTimePointIndex(MLint index)
Sets the time point index of this CSO.
virtual ~CSO()
Standard destructor.
const CSOAttributes & getAttributes() const
Returns const access to all CSO attributes.
Definition CSO.h:680
The Variant class stores different data types.
Definition mlVariant.h:36
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:489
CSOPathPointsStyle
Enumeration of line styles (order as StylePalette::LineStyle).
Definition CSODefines.h:45
Tvec3< MLdouble > Vector3
A vector with three components of type double.
Definition mlVector3.h:274