DART 6.10.1
Loading...
Searching...
No Matches
RenderInterface.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011-2021, The DART development contributors
3 * All rights reserved.
4 *
5 * The list of contributors can be found at:
6 * https://github.com/dartsim/dart/blob/master/LICENSE
7 *
8 * This file is provided under the following "BSD-style" License:
9 * Redistribution and use in source and binary forms, with or
10 * without modification, are permitted provided that the following
11 * conditions are met:
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19 * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef DART_GUI_RENDERINTERFACE_HPP_
34#define DART_GUI_RENDERINTERFACE_HPP_
35
36#include <vector>
37#include <Eigen/Dense>
38#include <assimp/scene.h>
39
41
42namespace dart {
43namespace gui {
44
50
60
69
71{
72public:
74 {
75 }
77 {
78 }
79
80 virtual void initialize();
81 virtual void destroy();
82
83 virtual void setViewport(int _x, int _y, int _width, int _height);
84 virtual void getViewport(int& _x, int& _y, int& _width, int& _height) const;
85
86 virtual void clear(const Eigen::Vector3d& _color);
87
88 virtual void setMaterial(
89 const Eigen::Vector3d& _diffuse,
90 const Eigen::Vector3d& _specular,
91 double _cosinePow);
92 virtual void getMaterial(
93 Eigen::Vector3d& _diffuse,
94 Eigen::Vector3d& _specular,
95 double& _cosinePow) const;
96 virtual void setDefaultMaterial();
97
98 virtual void pushMatrix();
99 virtual void popMatrix();
100 virtual void pushName(int _id);
101 virtual void popName();
102
103 virtual void translate(const Eigen::Vector3d& _offset); // glTranslate
104 virtual void rotate(const Eigen::Vector3d& _axis, double _rad); // glRotate
105 virtual void transform(const Eigen::Isometry3d& _transform); // glMultMatrix
106 virtual void scale(const Eigen::Vector3d& _scale); // glScale
107
108 virtual void drawSphere(double radius, int slices = 16, int stacks = 16);
109 virtual void drawMultiSphere(
110 const std::vector<std::pair<double, Eigen::Vector3d>>& spheres,
111 int slices = 16,
112 int stacks = 16);
113 virtual void drawEllipsoid(const Eigen::Vector3d& _size);
114 virtual void drawCube(const Eigen::Vector3d& _size);
115 virtual void drawOpenCylinder(
116 double baseRadius,
117 double topRadius,
118 double height,
119 int slices = 16,
120 int stacks = 16);
121 virtual void drawCylinder(
122 double _radius, double _height, int slices = 16, int stacks = 16);
123 virtual void drawCapsule(double _radius, double _height);
124 virtual void drawCone(double _radius, double _height);
125 virtual void drawPyramid(double baseWidth, double baseDepth, double height);
126 virtual void drawMesh(const Eigen::Vector3d& _scale, const aiScene* _mesh);
127 virtual void drawSoftMesh(const aiMesh* mesh);
128 virtual void drawList(unsigned int index);
129 virtual void drawLineSegments(
130 const std::vector<Eigen::Vector3d>& _vertices,
131 const common::aligned_vector<Eigen::Vector2i>& _connections);
132
133 virtual unsigned int compileDisplayList(
134 const Eigen::Vector3d& _size, const aiScene* _mesh);
135
136 virtual void setPenColor(const Eigen::Vector4d& _col);
137 virtual void setPenColor(const Eigen::Vector3d& _col);
138
139 virtual void setLineWidth(float _width);
140
141 virtual void saveToImage(
142 const char* _filename, DecoBufferType _buffType = BT_Back);
143 virtual void readFrameBuffer(
144 DecoBufferType _buffType, DecoColorChannel _ch, void* _pixels);
145};
146
147} // namespace gui
148} // namespace dart
149
150#endif // #ifndef DART_GUI_RENDERINTERFACE_HPP_
std::size_t index
Definition SkelParser.cpp:1672
Definition RenderInterface.hpp:71
virtual void clear(const Eigen::Vector3d &_color)
Definition RenderInterface.cpp:56
virtual void pushName(int _id)
Definition RenderInterface.cpp:86
virtual void pushMatrix()
Definition RenderInterface.cpp:78
virtual void setLineWidth(float _width)
Definition RenderInterface.cpp:192
virtual void drawSphere(double radius, int slices=16, int stacks=16)
Definition RenderInterface.cpp:110
virtual void drawCylinder(double _radius, double _height, int slices=16, int stacks=16)
Definition RenderInterface.cpp:166
virtual void drawOpenCylinder(double baseRadius, double topRadius, double height, int slices=16, int stacks=16)
Definition RenderInterface.cpp:157
virtual void getViewport(int &_x, int &_y, int &_width, int &_height) const
Definition RenderInterface.cpp:51
virtual void initialize()
Definition RenderInterface.cpp:38
RenderInterface()
Definition RenderInterface.hpp:73
virtual void drawEllipsoid(const Eigen::Vector3d &_size)
Definition RenderInterface.cpp:123
virtual void drawList(unsigned int index)
Definition RenderInterface.cpp:137
virtual void drawCapsule(double _radius, double _height)
Definition RenderInterface.cpp:171
virtual void drawPyramid(double baseWidth, double baseDepth, double height)
Definition RenderInterface.cpp:179
virtual void drawSoftMesh(const aiMesh *mesh)
Definition RenderInterface.cpp:132
virtual void translate(const Eigen::Vector3d &_offset)
Definition RenderInterface.cpp:94
virtual void drawMultiSphere(const std::vector< std::pair< double, Eigen::Vector3d > > &spheres, int slices=16, int stacks=16)
Definition RenderInterface.cpp:115
virtual void popName()
Definition RenderInterface.cpp:90
virtual void drawCone(double _radius, double _height)
Definition RenderInterface.cpp:175
virtual void setPenColor(const Eigen::Vector4d &_col)
Definition RenderInterface.cpp:184
virtual void setDefaultMaterial()
Definition RenderInterface.cpp:74
virtual void drawMesh(const Eigen::Vector3d &_scale, const aiScene *_mesh)
Definition RenderInterface.cpp:127
virtual void drawCube(const Eigen::Vector3d &_size)
Definition RenderInterface.cpp:153
virtual void popMatrix()
Definition RenderInterface.cpp:82
virtual void setViewport(int _x, int _y, int _width, int _height)
Definition RenderInterface.cpp:46
virtual void getMaterial(Eigen::Vector3d &_diffuse, Eigen::Vector3d &_specular, double &_cosinePow) const
Definition RenderInterface.cpp:67
virtual void saveToImage(const char *_filename, DecoBufferType _buffType=BT_Back)
Definition RenderInterface.cpp:196
virtual unsigned int compileDisplayList(const Eigen::Vector3d &_size, const aiScene *_mesh)
Definition RenderInterface.cpp:147
virtual void setMaterial(const Eigen::Vector3d &_diffuse, const Eigen::Vector3d &_specular, double _cosinePow)
Definition RenderInterface.cpp:60
virtual void scale(const Eigen::Vector3d &_scale)
Definition RenderInterface.cpp:106
virtual void rotate(const Eigen::Vector3d &_axis, double _rad)
Definition RenderInterface.cpp:98
virtual void readFrameBuffer(DecoBufferType _buffType, DecoColorChannel _ch, void *_pixels)
Definition RenderInterface.cpp:201
virtual void transform(const Eigen::Isometry3d &_transform)
Definition RenderInterface.cpp:102
virtual void drawLineSegments(const std::vector< Eigen::Vector3d > &_vertices, const common::aligned_vector< Eigen::Vector2i > &_connections)
Definition RenderInterface.cpp:141
virtual void destroy()
Definition RenderInterface.cpp:42
virtual ~RenderInterface()
Definition RenderInterface.hpp:76
std::vector< _Tp, Eigen::aligned_allocator< _Tp > > aligned_vector
Definition Memory.hpp:71
DecoBufferType
Definition RenderInterface.hpp:46
@ BT_Front
Definition RenderInterface.hpp:47
@ BT_Back
Definition RenderInterface.hpp:48
DecoDrawType
Definition RenderInterface.hpp:62
@ DT_SolidPolygon
Definition RenderInterface.hpp:64
@ DT_FrontPolygon
Definition RenderInterface.hpp:65
@ DT_BackPolygon
Definition RenderInterface.hpp:66
@ DT_WireFrame
Definition RenderInterface.hpp:63
@ DT_Max
Definition RenderInterface.hpp:67
DecoColorChannel
Definition RenderInterface.hpp:52
@ CC_B
Definition RenderInterface.hpp:55
@ CC_R
Definition RenderInterface.hpp:53
@ CC_RGBA
Definition RenderInterface.hpp:58
@ CC_A
Definition RenderInterface.hpp:56
@ CC_G
Definition RenderInterface.hpp:54
@ CC_RGB
Definition RenderInterface.hpp:57
Definition BulletCollisionDetector.cpp:65