| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef BALL_VIEW_RENDERING_RENDERERS_VRMLRENDERER_H |
| 6 |
#define BALL_VIEW_RENDERING_RENDERERS_VRMLRENDERER_H |
| 7 |
|
| 8 |
#ifndef BALL_VIEW_RENDERING_RENDERERS_RENDERER_H |
| 9 |
# include <BALL/VIEW/RENDERING/RENDERERS/renderer.h> |
| 10 |
#endif |
| 11 |
|
| 12 |
#ifndef BALL_SYSTEM_FILE_H |
| 13 |
# include <BALL/SYSTEM/file.h> |
| 14 |
#endif |
| 15 |
|
| 16 |
#ifndef BALL_MATHS_VECTOR3_H |
| 17 |
# include <BALL/MATHS/vector3.h> |
| 18 |
#endif |
| 19 |
|
| 20 |
#ifndef BALL_MATHS_MATRIX44_H |
| 21 |
# include <BALL/MATHS/matrix44.h> |
| 22 |
#endif |
| 23 |
|
| 24 |
namespace BALL |
| 25 |
{ |
| 26 |
namespace VIEW |
| 27 |
{ |
| 28 |
class ColorRGBA; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
class BALL_DEPRECATED BALL_VIEW_EXPORT VRMLRenderer : public Renderer |
| 41 |
{ |
| 42 |
public: |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
VRMLRenderer(); |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
VRMLRenderer(const String& name); |
| 56 |
|
| 57 |
|
| 58 |
virtual ~VRMLRenderer(); |
| 59 |
|
| 60 |
|
| 61 |
virtual void clear(); |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
void setFileName(const String& name); |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
String VRMLColorRGBA(const ColorRGBA& input); |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
String VRMLVector3(Vector3 input); |
| 81 |
|
| 82 |
|
| 83 |
void VRMLColor(const ColorRGBA& color); |
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
virtual bool init(const Stage& stage); |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
virtual bool finish(); |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
void renderSphere_(const Sphere& sphere); |
| 103 |
|
| 104 |
void renderMesh_(const Mesh& mesh); |
| 105 |
|
| 106 |
void renderLine_(const Line& miniTube); |
| 107 |
|
| 108 |
void renderTwoColoredLine_(const TwoColoredLine& miniTube); |
| 109 |
|
| 110 |
void renderTube_(const Tube& tube); |
| 111 |
|
| 112 |
void renderTwoColoredTube_(const TwoColoredTube& tube); |
| 113 |
|
| 114 |
void out_(const String& data); |
| 115 |
|
| 116 |
void outheader_(const String& data) |
| 117 |
{out_(data); current_indent_ += 1;} |
| 118 |
|
| 119 |
void outfinish_(const String& data) |
| 120 |
{out_(data); current_indent_ -= 1;} |
| 121 |
|
| 122 |
Size width, height; |
| 123 |
|
| 124 |
protected: |
| 125 |
|
| 126 |
void header_(const Vector3& translation, const ColorRGBA& color, |
| 127 |
const String& rotation = ""); |
| 128 |
|
| 129 |
void footer_(); |
| 130 |
|
| 131 |
File outfile_; |
| 132 |
|
| 133 |
Vector3 origin_; |
| 134 |
Matrix4x4 rotation_; |
| 135 |
Index current_indent_; |
| 136 |
|
| 137 |
|
| 138 |
float smallX, smallY, smallZ, bigX, bigY, bigZ; |
| 139 |
|
| 140 |
|
| 141 |
bool scalingUsed; |
| 142 |
}; |
| 143 |
|
| 144 |
} } |
| 145 |
|
| 146 |
#endif |