GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TraceStructure.h
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
34 
35 #ifndef TRACESTRUCTURE_H
36 #define TRACESTRUCTURE_H
37 
38 #include "vtkSmartPointer.h"
39 
40 class vtkActor;
41 class vtkPolyData;
42 class vtkProperty;
43 class vtkLookupTable;
44 
45 #include <ostream>
46 #include <vector>
47 
48 #include "QGoIOConfigure.h"
49 
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51 #include "StructureHelper.h"
52 #endif
53 
64 class QGOIO_EXPORT TraceStructure
65 {
66 public:
67 
69  unsigned int TraceID;
70 
72  unsigned int CollectionID;
73 
75  vtkActor *ActorXY;
76 
78  vtkActor *ActorXZ;
79 
81  vtkActor *ActorYZ;
82 
84  vtkActor *ActorXYZ;
85 
86 
87  vtkPolyData *Nodes;
88 
91 
95  bool Visible;
96 
98  double rgba[4];
99 
101  TraceStructure();
102 
104  TraceStructure( const unsigned int & iTraceID,
105  const unsigned int & iCollectionID,
106  std::vector< vtkActor * > iActors,
107  vtkPolyData *iNodes,
108  const bool & iHighlighted,
109  const bool & iVisible,
110  const double & r,
111  const double & g,
112  const double & b,
113  const double & alpha);
114 
116  TraceStructure( const unsigned int & iTraceID,
117  const unsigned int & iCollectionID,
118  std::vector< vtkActor * > iActors,
119  vtkPolyData *iNodes,
120  const bool & iHighlighted,
121  const bool & iVisible,
122  double iRgba[4]);
123 
125  TraceStructure( const unsigned int & iTraceID,
126  const unsigned int & iCollectionID,
127  vtkActor *iActorXY,
128  vtkActor *iActorYZ,
129  vtkActor *iActorXZ,
130  vtkActor *iActorXYZ,
131  vtkPolyData *iNodes,
132  const bool & iHighlighted,
133  const bool & iVisible,
134  const double & r,
135  const double & g,
136  const double & b,
137  const double & alpha);
138 
140  TraceStructure( const TraceStructure& iE );
141  virtual ~TraceStructure();
142 
145  void SetActorProperties( vtkProperty* iProperty ) const;
146 
149  void SetActorVisibility( const bool& iVisible ) const;
150 
155  void SetScalarData( const std::string& iName, const double& iValue ) const;
156 
160  void SetScalarRange( const double& iMin, const double& iMax ) const;
161 
163  void RenderWithOriginalColors() const;
164 
167  void SetLookupTable( const vtkLookupTable* iLut ) const;
168 
169  virtual void ReleaseData() const;
170 
172  friend std::ostream & operator<<
173  (std::ostream & os, const TraceStructure & c)
174  {
175  os << "TraceID " << c.TraceID << std::endl;
176 
177  os << "Highlighted " << c.Highlighted << std::endl;
178  os << "Visible " << c.Visible << std::endl;
179  os << "RGBA [" << c.rgba[0] << ", " << c.rgba[1] << ", " << c.rgba[2]
180  << ", " << c.rgba[3] << "]" << std::endl;
181 
182  os << "ActorXY " << c.ActorXY << std::endl;
183  os << "ActorXZ " << c.ActorXZ << std::endl;
184  os << "ActorYZ " << c.ActorYZ << std::endl;
185  os << "ActorXYZ " << c.ActorXYZ << std::endl;
186  os << "Nodes " << c.Nodes << std::endl;
187 
188  return os;
189  }
190 
191  void ResetNodes() const;
192 
193 };
194 
195 #endif // TRACESTRUCTURE_H
vtkActor * ActorXYZ
unsigned int TraceID
vtkActor * ActorYZ
vtkPolyData * Nodes
vtkActor * ActorXY
unsigned int CollectionID
vtkActor * ActorXZ
Structure which represent a trace (contour, mesh, track, lineage), and used for interaction between V...