FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
VertexSelectorInput.hpp
1#ifndef VERTECSELECTORINPUT_HPP
2#define VERTECSELECTORINPUT_HPP
3
4#include "VertexSelector.hpp"
5#include <sstream>
6#include <ocean/plankton/VValue.hpp>
7
8namespace Wizt
9{
10
13{
15
16 bool operator==(const VertexSelectorValue&V) const
17 {
18 return selector == V.selector;
19 }
20};
21
22//enable a slot for a VertexSelector
23template<>
25{
26public:
27 static bool setValueFromText( VertexSelectorValue& vsc,
28 const string& s )
29 {
30 return false;
31 }
32
33 static string Text( const VertexSelectorValue& vsv )
34 {
35 assert( vsv.selector && "VValueTrait< RefPtr<VertexSelector> >::Text() invalid pointer" );
36
38
39 char buf[512];
40 vsv.selector.speak(buf, "");
41
42 tmp << buf << ":";
43
44 return tmp.str();
45 }
46};
47
48
49// Enable collection of VertexSelections usable for slots
54
55template<>
57{
58public:
59 static bool setValueFromText( VertexSelectorCollection& vsc,
60 const string& s )
61 {
62 return false;
63 }
64
65 // Not sure if this is a good idea? To use the actual pointer information for text conversion and updating
66 // The selection should not be called for each text conversion and writing all the bools to
67 // text also seems not to be a good idea. (mr)
68 static string Text( const VertexSelectorCollection& vsc )
69 {
71
72 if( vsc.VertexSelections.size() > 0 )
73 {
74 for( unsigned i = 0; i < vsc.VertexSelections.size(); i++ )
75 {
76 //check for NullPtr()
77 if( vsc.VertexSelections[i] )
78 {
79 const RefPtr<VertexSelector>& current_selector = vsc.VertexSelections.at(i);
80 char buf[512];
81 current_selector.speak(buf, "");
82 tmp << buf << ":";
83 }
84 }
85
86 return tmp.str();
87 }
88
89 return "";
90 }
91};
92}
93
94#endif // VERTECSELECTORINPUT_HPP
basic_stringstream< char > stringstream
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
note: cannot derive from FloatingSkeletonRenderer as long as independent base class TriangleRenderer ...
Definition VertexSelectorInput.hpp:51
Proxy type for communicating VertexSelectors.
Definition VertexSelectorInput.hpp:13