SIVIC API  0.9.26
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
svkDataAcquisitionDescriptionXML.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2009-2014 The Regents of the University of California.
3  * All Rights Reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * • Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  * • Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12  * • None of the names of any campus of the University of California, the name
13  * "The Regents of the University of California," or the names of any of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
26  * OF SUCH DAMAGE.
27  */
28 
29 
30 
31 /*
32  * $URL$
33  * $Rev$
34  * $Author$
35  * $Date$
36  *
37  * Authors:
38  * Jason C. Crane, Ph.D.
39  * Beck Olson
40  */
41 
42 
43 #ifndef SVK_DATA_ACQUISITION_DESCRIPTION_XML_H
44 #define SVK_DATA_ACQUISITION_DESCRIPTION_XML_H
45 
54 #ifdef __cplusplus
55 
56 #include <vtkObject.h>
57 #include <vtkXMLDataElement.h>
58 #include <svkSatBandsXML.h>
59 #include <svkXMLUtils.h>
60 
61 #include "svkTypes.h"
62 
63 
64 namespace svk {
65 
66 
67 using namespace std;
68 
69 
93 class svkDataAcquisitionDescriptionXML: public vtkObject
94 {
95 
96  public:
97 
99  vtkTypeMacro( svkDataAcquisitionDescriptionXML, vtkObject);
100 
101  int SetXMLFileName( vtkstd::string xmlFileName );
102  vtkstd::string GetXMLFileName( );
103  void ClearXMLFile( );
104  void InitializeEmptyXMLFile( );
105  void SetVerbose( bool isVerbose );
106  int GetXMLVersion();
107  vtkXMLDataElement* FindNestedElementWithPath( string xmlPath);
108  const char* GetDataWithPath( const char* xmlPath );
109  int SetDataWithPath( const char* xmlPath, const char* value );
110  vtkXMLDataElement* AddElementWithParentPath( const char* xmlPath, const char* name );
111  int RemoveElementWithParentPath( const char* xmlPath, const char* name );
112 
113  vtkXMLDataElement* GetRootXMLDataElement();
114 
115  void GetEncodedSpace( int matrixSize[3], float fov[3] );
116  svkSatBandsXML* GetSatBandsXML();
117 
118  void SetTrajectoryType( vtkstd::string type );
119  vtkstd::string GetTrajectoryType( );
120 
121  void SetTrajectoryID( vtkstd::string ID );
122  vtkstd::string GetTrajectoryID( );
123 
124  void SetTrajectoryComment( vtkstd::string comment );
125  vtkstd::string GetTrajectoryComment( );
126 
127  void SetTrajectoryParameter( vtkstd::string name, long value );
128  long GetTrajectoryLongParameter( vtkstd::string name );
129 
130  void SetTrajectoryParameter( vtkstd::string name, double value );
131  double GetTrajectoryDoubleParameter( vtkstd::string name );
132 
133 
134  int WriteXMLFile( string xmlFileName );
135 
136 
137  protected:
138 
141 
142 
143  private:
144 
145  void SetTrajectoryParameter( vtkstd::string type, vtkstd::string name, vtkstd::string value );
146  vtkstd::string GetTrajectoryParameter( vtkstd::string type, vtkstd::string name );
147  vtkXMLDataElement* GetTrajectoryParameterElement( vtkstd::string type, vtkstd::string name );
148 
149  // Members:
150  float versionNumber;
151  bool isVerbose;
152  vtkstd::string xmlFileName;
153  vtkXMLDataElement* dataAcquisitionDescriptionXML;
154  vtkXMLDataElement* versionElement;
155  vtkXMLDataElement* satBandsElement;
156  svkSatBandsXML* satBandsXML;
157 
158 
159 };
160 
161 
162 } //svk
163 #endif
164 
165 #endif //SVK_DATA_ACQUISITION_DESCRIPTION_XML_H
166 
167 #ifdef __cplusplus
168 extern "C" {
169 #endif
170 
172 void* svkDataAcquisitionDescriptionXML_Delete( void* dataAcquisitionDescriptionXML );
173 void* svkDataAcquisitionDescriptionXML_Read(const char* xmlFileName, int* status);
174 int svkDataAcquisitionDescriptionXML_WriteXMLFile(const char* filepath, void* xml );
175 
176 const char* svkDataAcquisitionDescriptionXML_GetDataWithPath( void* xml, const char* path );
177 int svkDataAcquisitionDescriptionXML_SetDataWithPath( void* xml, const char* path, const char* data );
178 int svkDataAcquisitionDescriptionXML_AddElementWithParentPath( void* xml, const char* path, const char* name );
179 int svkDataAcquisitionDescriptionXML_RemoveElementWithParentPath( void* xml, const char* path, const char* name );
180 
181 void* svkDataAcquisitionDescriptionXML_GetSatBandsXML( void* dataAcquisitionDescriptionXML );
182 void svkDataAcquisitionDescriptionXML_SetTrajectory(const char* type, const char* id, const char* comment, void* xml);
186 void svkDataAcquisitionDescriptionXML_SetTrajectoryLongParameter(const char* name, long value, void* xml);
187 long svkDataAcquisitionDescriptionXML_GetTrajectoryLongParameter(const char* name, void* xml);
188 void svkDataAcquisitionDescriptionXML_SetTrajectoryDoubleParameter(const char* name, double value, void* xml);
189 double svkDataAcquisitionDescriptionXML_GetTrajectoryDoubleParameter(const char* name, void* xml);
190 
191 
192 #ifdef __cplusplus
193 }
194 #endif
void svkDataAcquisitionDescriptionXML_SetTrajectory(const char *type, const char *id, const char *comment, void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:828
int svkDataAcquisitionDescriptionXML_RemoveElementWithParentPath(void *xml, const char *path, const char *name)
Definition: svkDataAcquisitionDescriptionXML.cc:787
int svkDataAcquisitionDescriptionXML_WriteXMLFile(const char *filepath, void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:702
const char * svkDataAcquisitionDescriptionXML_GetTrajectoryComment(void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:878
const char * svkDataAcquisitionDescriptionXML_GetTrajectoryID(void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:862
Definition: svkSatBandsXML.h:78
int svkDataAcquisitionDescriptionXML_SetDataWithPath(void *xml, const char *path, const char *data)
Definition: svkDataAcquisitionDescriptionXML.cc:739
int svkDataAcquisitionDescriptionXML_AddElementWithParentPath(void *xml, const char *path, const char *name)
Definition: svkDataAcquisitionDescriptionXML.cc:760
const char * svkDataAcquisitionDescriptionXML_GetTrajectoryType(void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:846
void svkDataAcquisitionDescriptionXML_SetTrajectoryLongParameter(const char *name, long value, void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:896
long svkDataAcquisitionDescriptionXML_GetTrajectoryLongParameter(const char *name, void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:913
void * svkDataAcquisitionDescriptionXML_Read(const char *xmlFileName, int *status)
Definition: svkDataAcquisitionDescriptionXML.cc:682
Definition: svkDataAcquisitionDescriptionXML.h:93
void * svkDataAcquisitionDescriptionXML_New()
Definition: svkDataAcquisitionDescriptionXML.cc:649
void * svkDataAcquisitionDescriptionXML_GetSatBandsXML(void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:806
void svkDataAcquisitionDescriptionXML_SetTrajectoryDoubleParameter(const char *name, double value, void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:931
double svkDataAcquisitionDescriptionXML_GetTrajectoryDoubleParameter(const char *name, void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:949
const char * svkDataAcquisitionDescriptionXML_GetDataWithPath(void *xml, const char *path)
Definition: svkDataAcquisitionDescriptionXML.cc:720
void * svkDataAcquisitionDescriptionXML_Delete(void *xml)
Definition: svkDataAcquisitionDescriptionXML.cc:663