60 #ifndef ACG_ARROWNODE_HH
61 #define ACG_ARROWNODE_HH
66 #include <ACG/Scenegraph/MaterialNode.hh>
67 #include <ACG/GL/globjects.hh>
68 #include <ACG/GL/VertexDeclaration.hh>
73 namespace SceneGraph {
90 std::string _name=
"<ArrowNode>" );
103 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
106 void reserve(
int _n);
117 int addArrow(
const Vec3f& _start,
const Vec3f& _dir,
const Vec3f& _normal =
Vec3f(0.0f, 1.0f, 0.0f),
const Vec3f& _scale =
Vec3f(1.0f, 1.0f, 1.0f),
const Vec4uc& _color =
Vec4uc(82, 82, 82, 255));
139 int addArrow(
const Vec3d& _start,
const Vec3d& _dir,
const Vec3d& _normal =
Vec3d(0.0, 1.0, 0.0),
const Vec3d& _scale =
Vec3d(1.0, 1.0, 1.0),
const Vec4uc& _color =
Vec4uc(82, 82, 82, 255));
157 Vec3f arrowStart(
int _arrowID)
const;
164 void arrowStart(
int _arrowID,
const Vec3f& _start);
172 Vec3f arrowDir(
int _arrowID)
const;
179 void arrowDir(
int _arrowID,
const Vec3f& _dir);
187 Vec3f arrowNormal(
int _arrowID)
const;
194 void arrowNormal(
int _arrowID,
const Vec3f& _normal);
202 Vec3f arrowScale(
int _arrowID)
const;
210 void arrowScale(
int _arrowID,
const Vec3f& _scale);
217 Vec4uc arrowColor(
int _arrowID)
const;
224 void arrowColor(
int _arrowID,
const Vec4uc& _color);
230 int n_arrows()
const;
246 void createArrowMesh();
249 GLMatrixf computeWorldMatrix(
int _arrow)
const;
250 GLMatrixf readWorldMatrix(
int _arrow)
const;
251 void updateInstanceData();
253 void updateInstanceBuffer();
264 void orthonormalize();
267 std::vector<Arrow> arrows_;
272 GeometryBuffer vertexBuffer_;
273 IndexBuffer indexBuffer_;
275 Vec3f localArrowMin_;
276 Vec3f localArrowMax_;
284 int instanceDataOffset(
int _arrow)
const {
return _arrow * (4*3 + 3*3 +1);}
287 int instanceDataSize()
const {
return 4*3 + 3*3 + 1;}
290 std::vector<float> instanceData_;
293 GeometryBuffer instanceBuffer_;
297 bool invalidateInstanceData_;
298 bool invalidateInstanceBuffer_;
299 int supportsInstancing_;
307 #endif // ACG_ARROWNODE_HH defined
Namespace providing different geometric functions concerning angles.
VectorT< double, 3 > Vec3d
VectorT< float, 3 > Vec3f
VectorT< unsigned char, 4 > Vec4uc
Class to define the vertex input layout.