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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-05-23 21:11:44 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-05-23 21:11:44 +0400
commit96e79172a010cba6bc826f570832ef4b355ea0cd (patch)
tree5e7bee49170faff126fa52d8fd389642876e4021 /source/blender/freestyle/intern/view_map/Silhouette.h
parent2212564f1804e3cc866003b226eac89575d53ade (diff)
Made object names accessible from within style modules.
ViewShape objects in the view map, as well as SShape objects that can be retrieved with ViewShape::sshape(), now have a getName() method that returns the name of the object from which each shape is created. For instance, visible feature edges of specific mesh objects (e.g., Cube.001 and Cube.002) can be selected using custom predicate ObjectNamesUP1D as follows: class ObjectNamesUP1D(UnaryPredicate1D): def __init__(self, names): UnaryPredicate1D.__init__(self) self._names = names def getName(self): return "ObjectNamesUP1D" def __call__(self, viewEdge): return viewEdge.viewShape().getName() in self._names upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ObjectNamesUP1D(["Cube.001", "Cube.002"])) Operators.select(upred)
Diffstat (limited to 'source/blender/freestyle/intern/view_map/Silhouette.h')
-rwxr-xr-xsource/blender/freestyle/intern/view_map/Silhouette.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h
index fc0bff9cbff..86a4efcdc48 100755
--- a/source/blender/freestyle/intern/view_map/Silhouette.h
+++ b/source/blender/freestyle/intern/view_map/Silhouette.h
@@ -936,6 +936,7 @@ private:
vector<SVertex*> _verticesList; // list of all vertices
vector<FEdge*> _edgesList; // list of all edges
Id _Id;
+ string _Name;
BBox<Vec3r> _BBox;
vector<FrsMaterial> _FrsMaterials;
@@ -961,6 +962,7 @@ public:
{
userdata = 0;
_Id = iBrother._Id;
+ _Name = iBrother._Name;
_BBox = iBrother.bbox();
_FrsMaterials = iBrother._FrsMaterials;
@@ -1416,10 +1418,14 @@ public:
inline float importance() const {return _importance;}
/*! Returns the Id of the Shape. */
inline Id getId() const { return _Id; }
+ /*! Returns the name of the Shape. */
+ inline const string& getName() const { return _Name; }
/* Modififers */
/*! Sets the Id of the shape.*/
inline void setId(Id id) {_Id = id;}
+ /*! Sets the name of the shape.*/
+ inline void setName(const string& name) {_Name = name;}
/*! Sets the list of materials for the shape */
inline void setFrsMaterials(const vector<FrsMaterial>& iMaterials) {_FrsMaterials = iMaterials;}
inline void setViewShape(ViewShape *iShape) {_ViewShape = iShape;}