Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/freestyle/intern/stroke/StrokeRep.h')
-rw-r--r--source/blender/freestyle/intern/stroke/StrokeRep.h51
1 files changed, 44 insertions, 7 deletions
diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.h b/source/blender/freestyle/intern/stroke/StrokeRep.h
index d01b27215fe..8bbbd9240cb 100644
--- a/source/blender/freestyle/intern/stroke/StrokeRep.h
+++ b/source/blender/freestyle/intern/stroke/StrokeRep.h
@@ -36,6 +36,10 @@
#include "MEM_guardedalloc.h"
#endif
+extern "C" {
+#include "DNA_material_types.h"
+}
+
namespace Freestyle {
using namespace Geometry;
@@ -78,9 +82,13 @@ public:
return _point2d;
}
- inline Vec2r& texCoord()
+ inline Vec2r& texCoord(bool tips=false)
{
- return _texCoord;
+ if (tips) {
+ return _texCoord_w_tips;
+ }
+ else
+ return _texCoord;
}
inline Vec3r& color()
@@ -98,9 +106,14 @@ public:
_point2d = p;
}
- inline void setTexCoord(const Vec2r& p)
+ inline void setTexCoord(const Vec2r& p, bool tips=false)
{
- _texCoord = p;
+ if (tips) {
+ _texCoord_w_tips = p;
+ }
+ else {
+ _texCoord = p;
+ }
}
inline void setColor(const Vec3r& p)
@@ -116,6 +129,7 @@ public:
protected:
Vec2r _point2d;
Vec2r _texCoord;
+ Vec2r _texCoord_w_tips;
Vec3r _color;
float _alpha;
@@ -135,15 +149,15 @@ protected:
public:
Strip(const std::vector<StrokeVertex*>& iStrokeVertices, bool hasTips = false,
- bool tipBegin = false, bool tipEnd = false);
+ bool tipBegin = false, bool tipEnd = false, float texStep = 1.0);
Strip(const Strip& iBrother);
virtual ~Strip();
protected:
void createStrip(const std::vector<StrokeVertex*>& iStrokeVertices);
void cleanUpSingularities(const std::vector<StrokeVertex*>& iStrokeVertices);
- void computeTexCoord (const std::vector<StrokeVertex*>& iStrokeVertices);
- void computeTexCoordWithTips (const std::vector<StrokeVertex*>& iStrokeVertices, bool tipBegin, bool tipEnd);
+ void computeTexCoord (const std::vector<StrokeVertex*>& iStrokeVertices, float texStep);
+ void computeTexCoordWithTips (const std::vector<StrokeVertex*>& iStrokeVertices, bool tipBegin, bool tipEnd, float texStep);
public:
inline int sizeStrip() const
@@ -168,6 +182,9 @@ protected:
vector<Strip*> _strips;
Stroke::MediumType _strokeType;
unsigned int _textureId;
+ float _textureStep;
+ MTex *_mtex[MAX_MTEX];
+ Material *_material;
// float _averageTextureAlpha;
@@ -194,6 +211,16 @@ public:
return _textureId;
}
+ inline MTex *getMTex(int idx) const
+ {
+ return _mtex[idx];
+ }
+
+ inline Material *getMaterial() const
+ {
+ return _material;
+ }
+
inline vector<Strip*>& getStrips()
{
return _strips;
@@ -220,6 +247,16 @@ public:
_textureId = textureId;
}
+ inline void setMaterial(Material *mat)
+ {
+ _material = mat;
+ }
+ /*
+ inline void setMTex(int idx, MTex *mtex_ptr)
+ {
+ _mtex[idx] = mtex_ptr;
+ }*/
+
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:StrokeRep")
#endif