gepetto-viewer 6.0.0
An user-friendly Graphical Interface
Loading...
Searching...
No Matches
config-osg.h
Go to the documentation of this file.
1//
2// config-osg.h
3// gepetto-viewer
4//
5// Created by Justin Carpentier on 06/02/2014.
6// Modified by Mathieu Geisert in November 2014.
7// Copyright (c) 2014 LAAS-CNRS. All rights reserved.
8//
9
10#ifndef DynAndGraph_config_h
11#define DynAndGraph_config_h
12
13#include <gepetto/viewer/fwd.h>
15
16#include <QMetaType>
17#include <osg/AlphaFunc>
18#include <osg/AutoTransform>
19#include <osg/BlendFunc>
20#include <osg/Camera>
21#include <osg/ClearNode>
22#include <osg/Depth>
23#include <osg/Geode>
24#include <osg/Geometry>
25#include <osg/GraphicsContext>
26#include <osg/Group>
27#include <osg/Light>
28#include <osg/LightSource>
29#include <osg/LineWidth>
30#include <osg/Material>
31#include <osg/MatrixTransform>
32#include <osg/Node>
33#include <osg/PolygonMode>
34#include <osg/PositionAttitudeTransform>
35#include <osg/Shape>
36#include <osg/ShapeDrawable>
37#include <osg/State>
38#include <osg/StateSet>
39#include <osg/Switch>
40#include <osg/Viewport>
41#include <osgViewer/Viewer>
42#include <osgViewer/ViewerBase>
43
44namespace osg {
45
47
53DEF_OSG_CLASS_REF_PTR(ShapeDrawable)
55DEF_OSG_CLASS_REF_PTR(LineWidth)
56
58DEF_OSG_CLASS_REF_PTR(PositionAttitudeTransform)
59DEF_OSG_CLASS_REF_PTR(AutoTransform)
60DEF_OSG_CLASS_REF_PTR(MatrixTransform)
62DEF_OSG_CLASS_REF_PTR(LightSource)
63
67DEF_OSG_CLASS_REF_PTR(ClearNode)
68
70
71DEF_OSG_CLASS_REF_PTR(AlphaFunc)
72DEF_OSG_CLASS_REF_PTR(BlendFunc)
74
77
79
82DEF_OSG_CLASS_REF_PTR(GraphicsContext)
83
84DEF_OSG_CLASS_REF_PTR(Vec3Array)
85DEF_OSG_CLASS_REF_PTR(Vec4Array)
86
87DEF_OSG_CLASS_REF_PTR(PolygonMode)
88
89typedef ::osg::ref_ptr<GraphicsContext::Traits> TraitsRefPtr;
90
91} /* namespace osg */
92
93namespace osgViewer {
95
96} /* namespace osgViewer */
97
98typedef ::osg::Vec2f osgVector2;
99typedef ::osg::Vec3f osgVector3;
100typedef ::osg::Vec4f osgVector4;
101
102typedef ::osg::Quat osgQuat;
103
104namespace gepetto {
105namespace viewer {
106
108
110
112
114
121 explicit Configuration(const float* a, bool XYZW)
122 : position(a[0], a[1], a[2]),
123 quat(a[(XYZW ? 3 : 4)], a[(XYZW ? 4 : 5)], a[(XYZW ? 5 : 6)],
124 a[(XYZW ? 6 : 3)]) {}
125 Configuration(const osgVector3& p, const osgQuat& q) : position(p), quat(q) {}
126
127 bool operator==(const Configuration& other) const {
128 return position == other.position && quat == other.quat;
129 }
130
131 bool operator!=(const Configuration& other) const {
132 return position != other.position || quat != other.quat;
133 }
134
135 bool valid() const { return position.valid() && quat.asVec4().valid(); }
136};
137
138} /* namespace viewer */
139} /* namespace gepetto */
140
141Q_DECLARE_METATYPE(osgVector2)
142Q_DECLARE_METATYPE(osgVector3)
143Q_DECLARE_METATYPE(osgVector4)
144Q_DECLARE_METATYPE(gepetto::viewer::Configuration)
145
146#endif
::osg::Vec3f osgVector3
Definition config-osg.h:99
::osg::Quat osgQuat
Definition config-osg.h:102
::osg::Vec2f osgVector2
Definition config-osg.h:98
::osg::Vec4f osgVector4
Definition config-osg.h:100
#define DEF_OSG_CLASS_REF_PTR(className)
Definition macros.h:59
#define DEF_CLASS_SMART_PTR(className)
Definition macros.h:51
LightingMode
Definition config-osg.h:109
@ LIGHT_INFLUENCE_ON
Definition config-osg.h:109
@ LIGHT_INFLUENCE_OFF
Definition config-osg.h:109
WireFrameMode
Definition config-osg.h:111
@ FILL_AND_WIREFRAME
Definition config-osg.h:111
@ WIREFRAME
Definition config-osg.h:111
@ FILL
Definition config-osg.h:111
FaceMode
Definition config-osg.h:113
@ EDGE
Definition config-osg.h:113
@ FACE_AND_EDGE
Definition config-osg.h:113
@ FACE
Definition config-osg.h:113
VisibilityMode
Definition config-osg.h:107
@ VISIBILITY_OFF
Definition config-osg.h:107
@ VISIBILITY_ON
Definition config-osg.h:107
@ ALWAYS_ON_TOP
Definition config-osg.h:107
Definition action-search-bar.hh:27
Definition config-osg.h:93
Definition config-osg.h:44
::osg::ref_ptr< GraphicsContext::Traits > TraitsRefPtr
Definition config-osg.h:89
Definition config-osg.h:115
Configuration()
Definition config-osg.h:118
osgQuat quat
Definition config-osg.h:117
bool valid() const
Definition config-osg.h:135
bool operator==(const Configuration &other) const
Definition config-osg.h:127
Configuration(const osgVector3 &p, const osgQuat &q)
Definition config-osg.h:125
bool operator!=(const Configuration &other) const
Definition config-osg.h:131
Configuration(const float *a, bool XYZW)
Definition config-osg.h:121
osgVector3 position
Definition config-osg.h:116