34 m_minPt(0,0,0), m_maxPt(1,1,1),
40 for (
unsigned i=0; i< 3; ++i){
44 for (
unsigned i=0; i< 3; ++i){
81 for (
unsigned i = 0; i <
m_frames.size(); ++i){
95 m_minPt[ci] = std::min(f[ci] - corr, fo[ci] + corr);
96 m_maxPt[ci] = std::max(f[ci] - corr, fo[ci] + corr);
102 glEnable(GL_LINE_SMOOTH);
104 glDisable(GL_LIGHTING);
105 glColor3f(0.9,0.0, 0.0);
106 glBegin(GL_LINE_LOOP);
113 glBegin(GL_LINE_LOOP);
138 glDisable(GL_LINE_SMOOTH);
139 glEnable(GL_LIGHTING);
144 for (
unsigned i = 0; i <
m_frames.size(); ++i){
163 GLboolean lighting, colorMaterial;
164 glGetBooleanv(GL_LIGHTING, &lighting);
165 glGetBooleanv(GL_COLOR_MATERIAL, &colorMaterial);
167 glDisable(GL_COLOR_MATERIAL);
168 for (
unsigned i = 0; i <
m_frames.size(); ++i){
170 glMultMatrixd(
m_frames[i]->matrix());
175 if (
frame(i)->grabsMouse())
178 const float radius = length/20;
182 color[0] = 1.0f; color[1] = 0.7f; color[2] = 0.7f; color[3] = 1.0f;
184 glRotatef(90.0, 0.0, 1.0, 0.0);
186 }
else if (i%3 == 1){
187 color[0] = 0.7f; color[1] = 1.0f; color[2] = 0.7f; color[3] = 1.0f;
189 glRotatef(-90.0, 1.0, 0.0, 0.0);
193 color[0] = 0.7f; color[1] = 0.7f; color[2] = 1.0f; color[3] = 1.0f;
195 glTranslatef(0.0, 0.0, -length/2.0);
196 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
208 glEnable(GL_COLOR_MATERIAL);
210 glDisable(GL_LIGHTING);
231 for (
unsigned i = 0; i <
m_frames.size(); ++i){
244 const float radius = length/20;
246 GLboolean lighting, colorMaterial;
247 glGetBooleanv(GL_LIGHTING, &lighting);
248 glGetBooleanv(GL_COLOR_MATERIAL, &colorMaterial);
250 glDisable(GL_COLOR_MATERIAL);
253 color[0] = 0.7f; color[1] = 0.7f; color[2] = 1.0f; color[3] = 1.0f;
254 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
257 color[0] = 1.0f; color[1] = 0.7f; color[2] = 0.7f; color[3] = 1.0f;
258 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
260 glRotatef(90.0, 0.0, 1.0, 0.0);
264 color[0] = 0.7f; color[1] = 1.0f; color[2] = 0.7f; color[3] = 1.0f;
265 glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, color);
267 glRotatef(-90.0, 1.0, 0.0, 0.0);
272 glEnable(GL_COLOR_MATERIAL);
274 glDisable(GL_LIGHTING);
int getGrabbedFrame() const
static void drawArrow(float length=1.0f, float radius=-1.0f, int nbSubdivisions=12)
void setTranslationConstraint(Type type, const Vec &direction)
A ManipulatedFrame is a Frame that can be rotated and translated using the mouse. ...
void setRotationConstraint(Type type, const Vec &direction)
std::vector< qglviewer::ManipulatedFrame * > m_frames
void draw(bool withNames=false)
const qglviewer::ManipulatedFrame * frame(unsigned short i) const
void setConstraint(Constraint *const constraint)
The Vec class represents 3D positions and 3D vectors.
void drawAxis(float length=0.2f) const
void getBBXMax(float &x, float &y, float &z) const
void setTranslation(const Vec &translation)
void getBBXMin(float &x, float &y, float &z) const
An AxisPlaneConstraint defined in the world coordinate system.