MeVisLab Toolbox Reference
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
36
46
49#define addMemberAndAccessMethod(type, name) \
50 public:\
51 type name() const { return _##name; } \
52 void name(type value) { _##name = value; } \
53 protected: \
54 type _##name;
55
56#define addMemberAndAccessMethodWithCSO(type, name) \
57 public:\
58 type name() const { return _##name; } \
59 virtual type name(CSO* cso) const; \
60 void name(type value) { _##name = value; } \
61 protected: \
62 type _##name;
63
64#define overwriteAccessMethodsWithCSO(type, name) \
65 public:\
66 using CSOVisualizationSettings::name; \
67 virtual type name(CSO* cso) const override;
68
69
71
73{
74public:
77
78 bool isCSOVisible(CSO* cso) override;
79 void setStylePalette(StylePalette* stylePalette) { _stylePalette = stylePalette; }
80 overwriteAccessMethodsWithCSO(int, pathPointsOnSliceLineStyle);
81 overwriteAccessMethodsWithCSO(float, pathPointsOnSliceLineWidth);
82 overwriteAccessMethodsWithCSO(SbColor, pathPointsOnSliceColor);
83 overwriteAccessMethodsWithCSO(int, seedPointOnSliceStyle);
84 overwriteAccessMethodsWithCSO(float, seedPointOnSliceSize);
85 overwriteAccessMethodsWithCSO(SbColor, seedPointOnSliceColor);
86 //style palette settings
87 addMemberAndAccessMethod(bool, shouldUseStylePaletteLookUpForSeedPoints);
88 addMemberAndAccessMethod(int, stylePaletteLookUpSeedPoints);
89 // path points
90 addMemberAndAccessMethod(bool, shouldUseStylePaletteLookUpForPathPoints);
91 addMemberAndAccessMethod(int, stylePaletteLookUpPathPoints);
92 // visibility filtering
93 addMemberAndAccessMethod(int, visibleByMode);
94 addMemberAndAccessMethod(std::string, visibleIdList);
95 addMemberAndAccessMethod(bool, invertVisibility);
96
97public:
99private:
100
102 MLssize_t getStylePalettePathPointsLookUp(CSO* cso) const;
104 MLssize_t getStylePaletteSeedPointsLookUp(CSO* cso) const;
106 MLssize_t getStylePaletteLookUp(CSO* cso, int lookUpType) const;
108 bool hasStylePalette() const;
109
111 SbColor getColorFromStylePalette(MLssize_t index) const;
112 unsigned short getLineStyleFromStylePalette(MLssize_t index) const;
113 int getLineWidthFromStylePalette(MLssize_t index) const;
114 int getSeedPointStyleFromStylePalette(MLssize_t index) const;
115 int getSeedPointSizeFromStylePalette(MLssize_t index) const;
117 boost::unordered_set < int > _visibleIds;
118
119 StylePalette* _stylePalette;
120
122};
123
124#undef addMemberAndAccessMethodWithCSO
125#undef addMemberAndAccessMethod
126
#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 which is a signed 32 bit size_t on 32 bit platforms and 64 bit one on 64 bit ...
Definition mlTypeDefs.h:566
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.