ccPlanarEntityInterface.h 923 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef PLANAR_ENTITY_INTERFACE_HEADER
  2. #define PLANAR_ENTITY_INTERFACE_HEADER
  3. //CCCoreLib
  4. #include <CCGeom.h>
  5. //qCC_gl
  6. #include <ccGLDrawContext.h>
  7. //! Interface for a planar entity
  8. class ccPlanarEntityInterface
  9. {
  10. public:
  11. //! Default constructor
  12. ccPlanarEntityInterface();
  13. //! Show normal vector
  14. inline void showNormalVector(bool state) { m_showNormalVector = state; }
  15. //! Whether normal vector is shown or not
  16. inline bool normalVectorIsShown() const { return m_showNormalVector; }
  17. //! Returns the entity normal
  18. virtual CCVector3 getNormal() const = 0;
  19. virtual ~ccPlanarEntityInterface() = default;
  20. protected: //members
  21. //! Draws a normal vector (OpenGL)
  22. void glDrawNormal(CC_DRAW_CONTEXT& context, const CCVector3& pos, float scale, const ccColor::Rgb* color = 0);
  23. //! Whether the facet normal vector should be displayed or not
  24. bool m_showNormalVector;
  25. };
  26. #endif //PLANAR_ENTITY_INTERFACE_HEADER