00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef VRS_OPENGL_TEXTUREEDGESGL_H
00048 #define VRS_OPENGL_TEXTUREEDGESGL_H
00049
00050 #include <vrs/vector.h>
00051 #include <vrs/color.h>
00052 #include <vrs/monoattribute.h>
00053
00054 namespace VRS {
00055
00056 class Texture;
00057 class Image;
00058 class PolygonSet;
00059 template<typename T> class Iterator;
00060 template<typename T> class StaticArray;
00061
00062
00081 class VRS_CORE_API TextureEdgesGL : public MonoAttribute {
00082
00083 public:
00084 TextureEdgesGL(Image* strokeImage,
00085 Iterator<Vector>* minTexCoords,
00086 Iterator<Vector>* maxTexCoords,
00087 unsigned int style = 1,
00088 double width = 0.25, double lengthOffset = 0.0,
00089 double tiltOffset = 0.0, unsigned int hue = 100, Color color = Color(0.0, 0.0, 0.0),
00090 double depthOffset = 0.0, double fadeOutDist = 0, double maxDist = 0);
00091
00099 unsigned int getStyle() const;
00100 void setStyle(unsigned int style);
00106 double getWidth() const;
00107 void setWidth(double width);
00110 double getLengthOffset() const;
00111 void setLengthOffset(double offset);
00115 double getTiltOffset() const;
00116 void setTiltOffset(double offset);
00120 unsigned int getHue() const;
00121 void setHue(unsigned int hue);
00124 Color getColor() const;
00125 void setColor(const Color& color);
00128 double getDepthOffset() const;
00129 void setDepthOffset(double offset);
00136 double getFadeOutDistance() const;
00137 double getMaxDistance() const;
00138 void setFading(double fadeOutDist = 0, double maxDist = 0);
00146 static SO<PolygonSet> createEdgeGeometry(Iterator<Vector>* edges);
00152 SO<Texture> getStrokeTexture() const;
00153 SO<Iterator<Vector> > getMinTexCoords() const;
00154 SO<Iterator<Vector> > getMaxTexCoords() const;
00157 VRS_TYPEINFO(TextureEdgesGL, MonoAttribute);
00158 VRS_SERIALIZABLE(TextureEdgesGL);
00159
00160 private:
00161
00162 TextureEdgesGL();
00163 unsigned int style_;
00164 double width_;
00165 double lengthOffset_;
00166 double tiltOffset_;
00167 unsigned int hue_;
00168 Color color_;
00169 double depthOffset_;
00170 double fadeOutDist_;
00171 double maxDist_;
00172 SO<Texture> strokes_;
00173 SO<StaticArray<Vector> > minTexCoords_;
00174 SO<StaticArray<Vector> > maxTexCoords_;
00175 };
00176
00177 }
00178
00179 #endif // VRS_OPENGL_TEXTUREEDGESGL_H
00180
00181