Candidate_v1.7.0
        stable
      
      
        
          | Last change
 on this file since e9f307 was             07136a, checked in by Frederik Heber <heber@…>, 10 years ago | 
        
          | 
FIX: Fixing display of shapes in GLWorldView.
 we propagate shape name via S/S system such that we may lookup the name in
ShapeRegistry and do not have to rely on probably already deallocated
lastchanged() shape. This affects ShapeAdded() and ShapeRemoved().
GLMoleculeObject_shape now copies the shape, ensuring that its present
while its surface is tesselated.
 | 
        
          | 
              
Property                 mode
 set to                 100644 | 
        
          | File size:
            870 bytes | 
      
      
| Rev | Line |  | 
|---|
| [afd3d2] | 1 | /* | 
|---|
|  | 2 | * GLMoleculeObject_shape.hpp | 
|---|
|  | 3 | * | 
|---|
|  | 4 | *  Created on: Aug 3, 2012 | 
|---|
|  | 5 | *      Author: ankele | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #ifndef GLMOLECULEOBJECT_SHAPE_HPP_ | 
|---|
|  | 9 | #define GLMOLECULEOBJECT_SHAPE_HPP_ | 
|---|
|  | 10 |  | 
|---|
|  | 11 |  | 
|---|
|  | 12 | // include config.h | 
|---|
|  | 13 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 14 | #include <config.h> | 
|---|
|  | 15 | #endif | 
|---|
|  | 16 |  | 
|---|
|  | 17 |  | 
|---|
|  | 18 | #include <QtCore/qobject.h> | 
|---|
|  | 19 |  | 
|---|
|  | 20 | #include <Qt3D/qglpainter.h> | 
|---|
|  | 21 | #include <Qt3D/qglabstractscene.h> | 
|---|
|  | 22 |  | 
|---|
|  | 23 | #include "GLMoleculeObject.hpp" | 
|---|
|  | 24 |  | 
|---|
| [07136a] | 25 | #include "Shapes/Shape.hpp" | 
|---|
| [afd3d2] | 26 |  | 
|---|
|  | 27 | /** This class represents a triangulated Shape. | 
|---|
|  | 28 | * | 
|---|
|  | 29 | */ | 
|---|
|  | 30 | class GLMoleculeObject_shape : public GLMoleculeObject | 
|---|
|  | 31 | { | 
|---|
|  | 32 | Q_OBJECT | 
|---|
|  | 33 | public: | 
|---|
| [85c36d] | 34 | explicit GLMoleculeObject_shape(Shape &shape, QObject *parent=0); | 
|---|
| [afd3d2] | 35 | virtual ~GLMoleculeObject_shape(); | 
|---|
|  | 36 |  | 
|---|
|  | 37 | virtual void draw(QGLPainter *painter, const QVector4D &cameraPlane); | 
|---|
| [85c36d] | 38 | void enable(bool enabled); | 
|---|
|  | 39 | Shape *getShape(){ return &m_shape;  } | 
|---|
| [afd3d2] | 40 |  | 
|---|
|  | 41 | private: | 
|---|
|  | 42 |  | 
|---|
| [07136a] | 43 | Shape m_shape; | 
|---|
| [85c36d] | 44 | bool m_enabled; | 
|---|
| [afd3d2] | 45 | }; | 
|---|
|  | 46 |  | 
|---|
|  | 47 | #endif /* GLMOLECULEOBJECT_SHAPE_HPP_ */ | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.