20 #ifndef TULIPVIEWSETTINGS_H 21 #define TULIPVIEWSETTINGS_H 23 #include <tulip/tulipconf.h> 24 #include <tulip/Color.h> 25 #include <tulip/Size.h> 26 #include <tulip/Graph.h> 27 #include <tulip/Observable.h> 34 class TLP_SCOPE NodeShape {
39 BottomShadowedSphere = 21,
46 CubeOutlinedTransparent = 9,
52 LeftBottomShadowedSphere = 22,
54 RightBottomShadowedSphere = 23,
67 class TLP_SCOPE EdgeShape {
70 enum EdgeShapes { Polyline = 0, BezierCurve = 4, CatmullRomCurve = 8, CubicBSplineCurve = 16 };
73 class TLP_SCOPE EdgeExtremityShape {
76 enum EdgeExtremityShapes {
83 CubeOutlinedTransparent = 9,
98 class TLP_SCOPE LabelPosition {
101 enum LabelPositions { Center = 0, Top, Bottom, Left, Right };
104 class TLP_SCOPE TulipViewSettings :
public Observable {
107 typedef std::map<LabelPosition::LabelPositions, std::string> labelmap;
109 static TulipViewSettings &instance();
111 static labelmap POSITION_LABEL_MAP;
114 void setDefaultColor(
ElementType elem,
const Color &color);
117 void setDefaultBorderColor(
ElementType elem,
const Color &color);
120 void setdefaultBorderWidth(
ElementType elem,
float borderWidth);
122 Color defaultLabelColor()
const;
123 void setDefaultLabelColor(
const Color &color);
125 Color defaultLabelBorderColor()
const;
126 void setDefaultLabelBorderColor(
const Color &color);
128 float defaultLabelBorderWidth()
const;
129 void setDefaultLabelBorderWidth(
float borderWidth);
131 int defaultLabelPosition()
const;
132 void setDefaultLabelPosition(
int position);
135 void setDefaultSize(
ElementType elem,
const Size &size);
140 int defaultEdgeExtremitySrcShape()
const;
141 void setDefaultEdgeExtremitySrcShape(
int shape);
143 int defaultEdgeExtremityTgtShape()
const;
144 void setDefaultEdgeExtremityTgtShape(
int shape);
146 Size defaultEdgeExtremitySrcSize()
const;
147 void setDefaultEdgeExtremitySrcSize(
const Size &size);
149 Size defaultEdgeExtremityTgtSize()
const;
150 void setDefaultEdgeExtremityTgtSize(
const Size &size);
152 std::string defaultFontFile()
const;
153 void setDefaultFontFile(
const std::string &fontFile);
155 int defaultFontSize()
const;
156 void setDefaultFontSize(
int fontSize);
159 class TLP_SCOPE ViewSettingsEvent :
public tlp::Event {
162 enum ViewSettingsEventType {
163 TLP_DEFAULT_COLOR_MODIFIED,
164 TLP_DEFAULT_SHAPE_MODIFIED,
165 TLP_DEFAULT_SIZE_MODIFIED,
166 TLP_DEFAULT_LABEL_COLOR_MODIFIED
169 ViewSettingsEvent(
ElementType elem,
const Color &color)
170 : Event(TulipViewSettings::instance(), Event::TLP_MODIFICATION),
171 _type(TLP_DEFAULT_COLOR_MODIFIED), _elem(elem), _color(color) {}
173 ViewSettingsEvent(
ElementType elem,
const Size &size)
174 : Event(TulipViewSettings::instance(), Event::TLP_MODIFICATION),
175 _type(TLP_DEFAULT_SIZE_MODIFIED), _elem(elem), _size(size) {}
178 : Event(TulipViewSettings::instance(), Event::TLP_MODIFICATION),
179 _type(TLP_DEFAULT_SHAPE_MODIFIED), _elem(elem), _shape(shape) {}
181 ViewSettingsEvent(
const Color &labelColor)
182 : Event(TulipViewSettings::instance(), Event::TLP_MODIFICATION),
183 _type(TLP_DEFAULT_LABEL_COLOR_MODIFIED), _color(labelColor) {}
185 ViewSettingsEventType getType()
const {
193 Color getColor()
const {
197 Size getSize()
const {
201 int getShape()
const {
206 ViewSettingsEventType _type;
214 #endif // TULIPVIEWSETTINGS_H
Event is the base class for all events used in the Observation mechanism.