Prism.h

Go to the documentation of this file.
00001 #ifndef PRISM_H_
00002 #define PRISM_H_
00003 
00004 #include "BrushConstructor.h"
00005 #include "../../xyview/xywindow.h" // GlobalXYWnd_getCurrentViewType
00006 
00007 namespace brushconstruct
00008 {
00009     class Prism: public BrushConstructor
00010     {
00011         private:
00012             const int getViewAxis () const
00013             {
00014                 switch (GlobalXYWnd_getCurrentViewType()) {
00015                 case XY:
00016                     return 2;
00017                 case XZ:
00018                     return 1;
00019                 case YZ:
00020                     return 0;
00021                 }
00022                 return 2;
00023             }
00024 
00025             const float getMaxExtent2D (const Vector3& extents, int axis) const
00026             {
00027                 switch (axis) {
00028                 case 0:
00029                     return std::max(extents[1], extents[2]);
00030                 case 1:
00031                     return std::max(extents[0], extents[2]);
00032                 default:
00033                     return std::max(extents[0], extents[1]);
00034                 }
00035             }
00036 
00037         private:
00038 
00039             static const std::size_t _minSides = 3;
00040             static const std::size_t _maxSides = c_brush_maxFaces - 2;
00041 
00042         public:
00043             void generate (Brush& brush, const AABB& bounds, std::size_t sides, const TextureProjection& projection,
00044                     const std::string& shader);
00045 
00046             const std::string getName() const;
00047 
00048             static BrushConstructor& getInstance ()
00049             {
00050                 static Prism _prism;
00051                 return _prism;
00052             }
00053     };
00054 }
00055 #endif /* PRISM_H_ */

Generated by  doxygen 1.6.2