BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VIEW/KERNEL/common.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: common.h,v 1.40.16.4 2007/04/20 14:16:50 amoll Exp $
5 //
6 
7 #ifndef BALL_VIEW_KERNEL_COMMON_H
8 #define BALL_VIEW_KERNEL_COMMON_H
9 
10 #ifndef BALL_DATATYPE_STRING_H
11  #include <BALL/DATATYPE/string.h>
12 #endif
13 
14 #ifndef BALL_MATHS_VECTOR3
15  #include <BALL/MATHS/vector3.h>
16 #endif
17 
18 #ifndef BALL_CONCEPT_COMPOSITE_H
19  #include <BALL/CONCEPT/composite.h>
20 #endif
21 
22 #ifndef BALL_DATATYPE_REGULARDATA3D_H
24 #endif
25 
26 #include <QtCore/QEvent>
27 #include <QtGui/QColorDialog>
28 #include <QtGui/QLabel>
29 #include <QtGui/QDropEvent>
30 
31 namespace BALL
32 {
33  namespace VIEW
34  {
35 
36  class GeometricObject;
37  class MainControl;
38  class ColorRGBA;
39  class Camera;
40 
45 
50  #define VIEW_DEFAULT_PORT 20000
51 
54  #define BALL_ASSIGN_NAME(OBJ)\
55  OBJ->setObjectName(#OBJ);
56 
58 
64 
71  enum EventsIDs
72  {
74  MESSAGE_EVENT = 60000,
75 
78 
81 
84 
87 
90 
93 
96 
99  };
100 
102 
107 
110  {
113 
116 
119 
122  };
123 
125  #define BALL_VIEW_MAXIMAL_DRAWING_MODE 4
126 
129  {
132 
135 
138 
141 
144  };
145 
147  #define BALL_VIEW_MAXIMAL_DRAWING_PRECISION 4
148 
150  #define BALL_VIEW_MAXIMAL_DISPLAY_LIST_OBJECT_SIZE BALL_VIEW_MAXIMAL_DRAWING_PRECISION * BALL_VIEW_MAXIMAL_DRAWING_MODE
151 
154 
166  {
169 
172 
175 
178 
181 
184 
187 
190 
193 
196 
199 
200  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
201  // add new model types before this comment!!!!
202  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
203 
205  MODEL_LABEL = 100,
206 
209 
212 
215 
218 
221 
224 
227 
230 
233 
236  };
237 
238 
243  {
246 
249 
252 
255 
258 
261 
264 
267 
270 
273 
276 
279 
280  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
281  // add new coloring types before this comment!!!!
282  // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
283 
286 
289  };
290 
296 
298 
301 
303  BALL_VIEW_EXPORT bool stringToVector3(const String& data, Vector3& v);
304 
306  BALL_VIEW_EXPORT String createFloatString(float value, Size precision);
307 
316 
319 
322 
325  : public QEvent
326  {
327  public:
328 
330  LogEvent();
331 
333  void setMessage(const String& msg) {message_ = msg;}
334 
336  String getMessage() {return message_;}
337 
339  bool isImportant() { return important_;}
340 
342  void setImportant(bool state) { important_ = state;}
343 
345  bool showOnlyInLogView() const { return only_log_;}
346 
348  void setShowOnlyInLogView(bool state) { only_log_ = state;}
349 
350  protected:
353  bool only_log_;
354  };
355 
357  BALL_VIEW_EXPORT void logString(const String& data);
358 
360  #define BALLVIEW_DEBUG logString(String("A problem occured in ") + __FILE__ + " " + \
361  String(__LINE__) + ". Please notify us per mail: ball@bioinf.uni-sb.de\n");
362 
363 
364  BALL_VIEW_EXPORT void processDropEvent(QDropEvent* e);
365 
369  BALL_VIEW_EXPORT Camera focusCamera(Composite* composite);
370 
374  BALL_VIEW_EXPORT Camera focusCamera(const std::list<Vector3>& points);
375 
377  BALL_VIEW_EXPORT String ascii(const QString& str);
378 
380  BALL_VIEW_EXPORT ColorRGBA getColor(const QLabel* label);
381 
383  BALL_VIEW_EXPORT void setColor(const QLabel* label, const ColorRGBA& color);
384 
386  BALL_VIEW_EXPORT QColor chooseColor(QLabel* label);
387 
389  BALL_VIEW_EXPORT void setTextColor(QLabel* label, const ColorRGBA& color);
390 
394  BALL_VIEW_EXPORT void cubicInterpolation(const Vector3& a, const Vector3& b,
395  const Vector3& tangent_a, const Vector3& tangent_b,
396  std::vector<Vector3>& interpolated_values);
397 
400  extern float icosaeder_vertices[12][3];
401  extern Position icosaeder_indices[20][3];
402 
403  BALL_VIEW_EXPORT void subdivideTriangle(vector<Vector3>& results, Vector3& v1, Vector3& v2, Vector3& v3, Size precision);
404 
405  BALL_VIEW_EXPORT vector<Vector3> createSphere(Size precision);
406 
407  BALL_VIEW_EXPORT void calculateHistogramEqualization(const vector<float>& values, vector<float>& normalized_values, bool use_absolute_values = false);
408 
410  BALL_VIEW_EXPORT void calculateRandomPoints(const RegularData3D& grid, Size nr_points, vector<Vector3>& resulting_points);
411 
413 
414  } // namespace VIEW
415 } // namespace BALL
416 
417 #endif // BALL_VIEW_KERNEL_COMMON_H
BALL_VIEW_EXPORT bool stringToVector3(const String &data, Vector3 &v)
defines the property for the model: Ball and Stick
BALL_VIEW_EXPORT void setTextColor(QLabel *label, const ColorRGBA &color)
defines the property for the model: Label
BALL_VIEW_EXPORT String ascii(const QString &str)
BALL_VIEW_EXPORT String createTemporaryFilename()
Create a temporary filename in the users home dir.
defines the property for the model: Ribbon
BALL_VIEW_EXPORT void calculateRandomPoints(const RegularData3D &grid, Size nr_points, vector< Vector3 > &resulting_points)
calcualte a random set of points, dependening of the field strength of a grid
void setMessage(const String &msg)
DrawingMode
Enumeration for Drawing Modes.
defines the property for the model: solvent-accessible surface
defines the property for the model: Backbone
void setShowOnlyInLogView(bool state)
BALL_VIEW_EXPORT void setColor(const QLabel *label, const ColorRGBA &color)
DrawingPrecision
Enumeration for Drawing Precisions.
BALL_VIEW_EXPORT String vector3ToString(const Vector3 &v)
BALL_VIEW_EXPORT void subdivideTriangle(vector< Vector3 > &results, Vector3 &v1, Vector3 &v2, Vector3 &v3, Size precision)
BALL_VIEW_EXPORT void calculateHistogramEqualization(const vector< float > &values, vector< float > &normalized_values, bool use_absolute_values=false)
BALL_VIEW_EXPORT MainControl * getMainControl()
bool showOnlyInLogView() const
only show in logview, no change to status bar
Event that encodes a head tracker position change.
defines the property for the model: Cartoon
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
An event with a contained VIEW message.
TRegularData3D< float > RegularData3D
defines the property for the model: solvent-excluded surface
Event for button press events of custom input devices.
BALL_VIEW_EXPORT Composite composite_to_be_ignored_for_colorprocessors_
BALL_VIEW_EXPORT void processDropEvent(QDropEvent *e)
defines the property for the model: Stick
float icosaeder_vertices[12][3]
Code to refine a icosaeder:
defines the property for the model: Lines
Event posted by renderers after a new buffer is available.
TVector3< float > Vector3
Definition: vector3.h:1084
BALL_VIEW_EXPORT ColorRGBA getColor(const QLabel *label)
Event that encodes a 6 dimensional transformation.
defines the property for the model: H-Bonds
bool isImportant()
will allways be shown in Statusbar or just when no other message shown?
defines the property for the model: proximity light
BALL_SIZE_TYPE Size
BALL_VIEW_EXPORT void cubicInterpolation(const Vector3 &a, const Vector3 &b, const Vector3 &tangent_a, const Vector3 &tangent_b, std::vector< Vector3 > &interpolated_values)
BALL_VIEW_EXPORT Camera focusCamera(Composite *composite)
defines the property for the model: contour surface
BALL_VIEW_EXPORT void logString(const String &data)
thread safe output to logview
Event class used for thread safe output to logview.
BALL_VIEW_EXPORT QColor chooseColor(QLabel *label)
void setImportant(bool state)
defines the property for the model: Van der Waals
BALL_VIEW_EXPORT Vector3 getNormal(const Vector3 &v)
Event for passing BALL Messages accross threads.
BALL_VIEW_EXPORT String createFloatString(float value, Size precision)
create a string from a float and cut after a given number of digits after the dot ...
BALL_VIEW_EXPORT float SurfaceDrawingPrecisions[4]
Mapping from the enum to the float values of Surfaces.
Event for button press events of custom input devices.
Event to print output from a Thread.
BALL_VIEW_EXPORT vector< Vector3 > createSphere(Size precision)
Event that encodes a motion tracker position change.
BALL_SIZE_TYPE Position
Position icosaeder_indices[20][3]