MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
CSOVisualizationSettingsWithStylePalette.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2016, 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#include <SoCSOSystem.h>
18#include <SoCSODefines.h>
19#include <mlStylePalette.h>
21
22#include <ThirdPartyWarningsDisable.h>
23#include <boost/unordered_set.hpp>
24#include <ThirdPartyWarningsRestore.h>
25
27
30
35
44
47#define addMemberAndAccessMethod(type, name) \
48public: \
49 type name() const \
50 { \
51 return _##name; \
52 } \
53 void name(type value) \
54 { \
55 _##name = value; \
56 } \
57 \
58protected: \
59 type _##name;
60
61#define addMemberAndAccessMethodWithCSO(type, name) \
62public: \
63 type name() const \
64 { \
65 return _##name; \
66 } \
67 virtual type name(CSO* cso) const; \
68 void name(type value) \
69 { \
70 _##name = value; \
71 } \
72 \
73protected: \
74 type _##name;
75
76#define overwriteAccessMethodsWithCSO(type, name) \
77public: \
78 using CSOVisualizationSettings::name; \
79 virtual type name(CSO* cso) const override;
80
81
83
85{
86public:
89
90 bool isCSOVisible(CSO* cso) override;
91 void setStylePalette(StylePalette* stylePalette)
92 {
93 _stylePalette = stylePalette;
94 }
95 overwriteAccessMethodsWithCSO(int, pathPointsOnSliceLineStyle);
96 overwriteAccessMethodsWithCSO(float, pathPointsOnSliceLineWidth);
97 overwriteAccessMethodsWithCSO(SbColor, pathPointsOnSliceColor);
98 overwriteAccessMethodsWithCSO(int, seedPointOnSliceStyle);
99 overwriteAccessMethodsWithCSO(float, seedPointOnSliceSize);
100 overwriteAccessMethodsWithCSO(SbColor, seedPointOnSliceColor);
101 // style palette settings
102 addMemberAndAccessMethod(bool, shouldUseStylePaletteLookUpForSeedPoints);
103 addMemberAndAccessMethod(int, stylePaletteLookUpSeedPoints);
104 // path points
105 addMemberAndAccessMethod(bool, shouldUseStylePaletteLookUpForPathPoints);
106 addMemberAndAccessMethod(int, stylePaletteLookUpPathPoints);
107 // visibility filtering
108 addMemberAndAccessMethod(int, visibleByMode);
109 addMemberAndAccessMethod(std::string, visibleIdList);
110 addMemberAndAccessMethod(bool, invertVisibility);
111
112public:
114
115private:
117 MLssize_t getStylePalettePathPointsLookUp(CSO* cso) const;
119 MLssize_t getStylePaletteSeedPointsLookUp(CSO* cso) const;
121 MLssize_t getStylePaletteLookUp(CSO* cso, int lookUpType) const;
123 bool hasStylePalette() const;
124
126 SbColor getColorFromStylePalette(MLssize_t index) const;
127 unsigned short getLineStyleFromStylePalette(MLssize_t index) const;
128 int getLineWidthFromStylePalette(MLssize_t index) const;
129 int getSeedPointStyleFromStylePalette(MLssize_t index) const;
130 int getSeedPointSizeFromStylePalette(MLssize_t index) const;
132 boost::unordered_set<int> _visibleIds;
133
134 StylePalette* _stylePalette;
135
137};
138
139#undef addMemberAndAccessMethodWithCSO
140#undef addMemberAndAccessMethod
141
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition SoCSOSystem.h:21
addMemberAndAccessMethod(int, stylePaletteLookUpPathPoints)
overwriteAccessMethodsWithCSO(float, seedPointOnSliceSize)
addMemberAndAccessMethod(int, stylePaletteLookUpSeedPoints)
overwriteAccessMethodsWithCSO(SbColor, pathPointsOnSliceColor)
overwriteAccessMethodsWithCSO(int, seedPointOnSliceStyle)
addMemberAndAccessMethod(bool, shouldUseStylePaletteLookUpForSeedPoints)
addMemberAndAccessMethod(bool, shouldUseStylePaletteLookUpForPathPoints)
overwriteAccessMethodsWithCSO(int, pathPointsOnSliceLineStyle)
CSOVisualizationSettingsWithStylePalette()
Constructor sets members to default values.
addMemberAndAccessMethod(std::string, visibleIdList)
overwriteAccessMethodsWithCSO(SbColor, seedPointOnSliceColor)
overwriteAccessMethodsWithCSO(float, pathPointsOnSliceLineWidth)
addMemberAndAccessMethod(bool, invertVisibility)
The CSO represents a contour segmentation object.
Definition CSO.h:44
Base object class StylePalette for providing a collection of colors, line styles and marker types.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non-existing export symbol.
SSIZE_T MLssize_t
The signed ML size type that is a signed 32-bit size_t on 32-bit platforms and 64-bit one on 64-bit p...
Definition mlTypeDefs.h:563
CSOStylePaletteLookUpType
Defines how the optionally attached StylePalette should be used.
CSOVisibleObjectIdsFor
Mode for setting the CSOs' or CSOGroups' visibility by their id.
@ CSOs
Ids represent CSO ids.
@ Groups
Ids represent Group ids.