Skip to content

Commit 0cc68f8

Browse files
committed
Reformat
1 parent e103014 commit 0cc68f8

File tree

3 files changed

+312
-304
lines changed

3 files changed

+312
-304
lines changed

src/Core/Matlab/fieldtomatlab.h

Lines changed: 143 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
/*
2-
For more information, please see: http://software.sci.utah.edu
3-
4-
The MIT License
5-
6-
Copyright (c) 2009 Scientific Computing and Imaging Institute,
7-
University of Utah.
8-
9-
10-
Permission is hereby granted, free of charge, to any person obtaining a
11-
copy of this software and associated documentation files (the "Software"),
12-
to deal in the Software without restriction, including without limitation
13-
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14-
and/or sell copies of the Software, and to permit persons to whom the
15-
Software is furnished to do so, subject to the following conditions:
16-
17-
The above copyright notice and this permission notice shall be included
18-
in all copies or substantial portions of the Software.
19-
20-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21-
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23-
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26-
DEALINGS IN THE SOFTWARE.
2+
For more information, please see: http://software.sci.utah.edu
3+
4+
The MIT License
5+
6+
Copyright (c) 2009 Scientific Computing and Imaging Institute,
7+
University of Utah.
8+
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a
11+
copy of this software and associated documentation files (the "Software"),
12+
to deal in the Software without restriction, including without limitation
13+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
and/or sell copies of the Software, and to permit persons to whom the
15+
Software is furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included
18+
in all copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26+
DEALINGS IN THE SOFTWARE.
2727
*/
2828

2929
// THIS FILE CONTAINS MOST OF THE FUNCTIONALITY TO MAP A SCIRUN::FIELD OBJECT
@@ -50,138 +50,140 @@
5050
// THE CODE EVEN IF IT IS NOT USED.....
5151

5252
/*
53-
* FILE: matlabconverter_fieldtomatlab.h
54-
* AUTH: Jeroen G Stinstra
55-
* DATE: 18 MAR 2004
56-
*/
57-
53+
* FILE: matlabconverter_fieldtomatlab.h
54+
* AUTH: Jeroen G Stinstra
55+
* DATE: 18 MAR 2004
56+
*/
57+
5858
#ifndef CORE_MATLABIO_MATLABCONVERTER_FIELDTOMATLAB_H
5959
#define CORE_MATLABIO_MATLABCONVERTER_FIELDTOMATLAB_H 1
6060

6161
#include <Core/Matlab/matfilebase.h>
6262
#include <Core/Matlab/share.h>
6363

64-
namespace MatlabIO {
64+
namespace SCIRun
65+
{
66+
namespace MatlabIO
67+
{
6568

69+
class SCISHARE FieldToMatlabAlgo : public matfilebase
70+
{
71+
public:
6672

67-
class SCISHARE FieldToMatlabAlgo : public matfilebase
68-
{
69-
public:
70-
71-
//////// CONSTRUCTOR ///////////////////////////////////
72-
inline FieldToMatlabAlgo();
73-
virtual ~FieldToMatlabAlgo();
74-
75-
//////// OPTIONS FOR CONVERTER ////////////////////////
76-
77-
// Set the index base for the matlab code, normally htis one is 1
78-
inline void option_indexbase(int indexbase);
79-
// Option to switch on the old way of dealing with tensors, the ordering
80-
// is different. When switched off, ordering will be same as SCIRun
81-
// ordering.
82-
inline void option_oldtensor(bool value);
83-
// When isoparametric the connectivity matrix of mesh and field should
84-
// be the same hence one can specify to remove it if not wanted
85-
inline void option_nofieldconnectivity(bool value);
86-
// Force old naming scheme when exporting, this will not work for H.O.
87-
// elements.
88-
inline void option_forceoldnames(bool value);
89-
90-
//////// DYNAMIC ALGO ENTRY POINT /////////////////////
91-
92-
virtual bool execute(SCIRun::FieldHandle fieldH, matlabarray &mlarray);
93-
94-
inline void setreporter(SCIRun::ProgressReporter* pr);
95-
96-
protected:
97-
98-
bool mladdmeshheader(SCIRun::FieldInformation fi, matlabarray mlarray);
99-
bool mladdnodes(SCIRun::VMesh* mesh,matlabarray mlarray);
100-
bool mladdedges(SCIRun::VMesh* mesh,matlabarray mlarray);
101-
bool mladdfaces(SCIRun::VMesh* mesh,matlabarray mlarray);
102-
bool mladdcells(SCIRun::VMesh* mesh,matlabarray mlarray);
103-
bool mladdmeshderivatives(SCIRun::VMesh* mesh,matlabarray mlarray);
104-
105-
bool mladdtransform(SCIRun::VMesh* mesh,matlabarray mlarray);
106-
bool mladdxyzmesh1d(SCIRun::VMesh* mesh,matlabarray mlarray);
107-
bool mladdxyzmesh2d(SCIRun::VMesh* mesh,matlabarray mlarray);
108-
bool mladdxyzmesh3d(SCIRun::VMesh* mesh,matlabarray mlarray);
109-
110-
bool mladddimension1d(SCIRun::VMesh* mesh,matlabarray mlarray);
111-
bool mladddimension2d(SCIRun::VMesh* mesh,matlabarray mlarray);
112-
bool mladddimension3d(SCIRun::VMesh* mesh,matlabarray mlarray);
113-
114-
bool mladdfieldheader(SCIRun::FieldInformation fi, matlabarray mlarray);
115-
116-
bool mladdfielddata(SCIRun::VField* field,SCIRun::VMesh* mesh,matlabarray mlarray);
117-
118-
bool mladdfieldedges(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
119-
bool mladdfieldfaces(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
120-
bool mladdfieldcells(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
121-
122-
bool mladdfieldedgederivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
123-
bool mladdfieldfacederivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
124-
bool mladdfieldcellderivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
125-
126-
bool mladdfieldderivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
127-
128-
129-
//////// ERROR REPORTERING MECHANISM /////////////////
130-
131-
inline void error(std::string error);
132-
inline void warning(std::string warning);
133-
134-
//////// OPTION PARAMETERS //////////////////////////
135-
136-
bool option_forceoldnames_;
137-
bool option_nofieldconnectivity_;
138-
int option_indexbase_;
139-
140-
private:
141-
SCIRun::ProgressReporter *pr_;
142-
143-
};
144-
145-
inline FieldToMatlabAlgo::FieldToMatlabAlgo() :
146-
option_forceoldnames_(false),
147-
option_nofieldconnectivity_(false),
148-
option_indexbase_(1),
149-
pr_(0)
150-
{
151-
}
73+
//////// CONSTRUCTOR ///////////////////////////////////
74+
inline FieldToMatlabAlgo();
75+
virtual ~FieldToMatlabAlgo();
15276

153-
inline void FieldToMatlabAlgo::setreporter(SCIRun::ProgressReporter* pr)
154-
{
155-
pr_ = pr;
156-
}
77+
//////// OPTIONS FOR CONVERTER ////////////////////////
15778

79+
// Set the index base for the matlab code, normally htis one is 1
80+
inline void option_indexbase(int indexbase);
81+
// Option to switch on the old way of dealing with tensors, the ordering
82+
// is different. When switched off, ordering will be same as SCIRun
83+
// ordering.
84+
inline void option_oldtensor(bool value);
85+
// When isoparametric the connectivity matrix of mesh and field should
86+
// be the same hence one can specify to remove it if not wanted
87+
inline void option_nofieldconnectivity(bool value);
88+
// Force old naming scheme when exporting, this will not work for H.O.
89+
// elements.
90+
inline void option_forceoldnames(bool value);
15891

159-
inline void FieldToMatlabAlgo::option_forceoldnames(bool value)
160-
{
161-
option_forceoldnames_ = value;
162-
}
92+
//////// DYNAMIC ALGO ENTRY POINT /////////////////////
16393

164-
inline void FieldToMatlabAlgo::option_nofieldconnectivity(bool value)
165-
{
166-
option_nofieldconnectivity_ = value;
167-
}
94+
virtual bool execute(SCIRun::FieldHandle fieldH, matlabarray &mlarray);
16895

169-
inline void FieldToMatlabAlgo::option_indexbase(int indexbase)
170-
{
171-
option_indexbase_ = indexbase;
172-
}
96+
inline void setreporter(SCIRun::ProgressReporter* pr);
17397

174-
inline void FieldToMatlabAlgo::error(std::string error)
175-
{
176-
if(pr_) pr_->error(error);
177-
}
98+
protected:
17899

179-
inline void FieldToMatlabAlgo::warning(std::string warning)
180-
{
181-
if(pr_) pr_->warning(warning);
182-
}
100+
bool mladdmeshheader(SCIRun::FieldInformation fi, matlabarray mlarray);
101+
bool mladdnodes(SCIRun::VMesh* mesh,matlabarray mlarray);
102+
bool mladdedges(SCIRun::VMesh* mesh,matlabarray mlarray);
103+
bool mladdfaces(SCIRun::VMesh* mesh,matlabarray mlarray);
104+
bool mladdcells(SCIRun::VMesh* mesh,matlabarray mlarray);
105+
bool mladdmeshderivatives(SCIRun::VMesh* mesh,matlabarray mlarray);
106+
107+
bool mladdtransform(SCIRun::VMesh* mesh,matlabarray mlarray);
108+
bool mladdxyzmesh1d(SCIRun::VMesh* mesh,matlabarray mlarray);
109+
bool mladdxyzmesh2d(SCIRun::VMesh* mesh,matlabarray mlarray);
110+
bool mladdxyzmesh3d(SCIRun::VMesh* mesh,matlabarray mlarray);
111+
112+
bool mladddimension1d(SCIRun::VMesh* mesh,matlabarray mlarray);
113+
bool mladddimension2d(SCIRun::VMesh* mesh,matlabarray mlarray);
114+
bool mladddimension3d(SCIRun::VMesh* mesh,matlabarray mlarray);
115+
116+
bool mladdfieldheader(SCIRun::FieldInformation fi, matlabarray mlarray);
117+
118+
bool mladdfielddata(SCIRun::VField* field,SCIRun::VMesh* mesh,matlabarray mlarray);
119+
120+
bool mladdfieldedges(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
121+
bool mladdfieldfaces(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
122+
bool mladdfieldcells(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
123+
124+
bool mladdfieldedgederivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
125+
bool mladdfieldfacederivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
126+
bool mladdfieldcellderivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
127+
128+
bool mladdfieldderivatives(SCIRun::VField *field,SCIRun::VMesh *mesh,matlabarray mlarray);
129+
130+
131+
//////// ERROR REPORTERING MECHANISM /////////////////
132+
133+
inline void error(std::string error);
134+
inline void warning(std::string warning);
135+
136+
//////// OPTION PARAMETERS //////////////////////////
137+
138+
bool option_forceoldnames_;
139+
bool option_nofieldconnectivity_;
140+
int option_indexbase_;
141+
142+
private:
143+
SCIRun::ProgressReporter *pr_;
144+
145+
};
146+
147+
inline FieldToMatlabAlgo::FieldToMatlabAlgo() :
148+
option_forceoldnames_(false),
149+
option_nofieldconnectivity_(false),
150+
option_indexbase_(1),
151+
pr_(0)
152+
{
153+
}
154+
155+
inline void FieldToMatlabAlgo::setreporter(SCIRun::ProgressReporter* pr)
156+
{
157+
pr_ = pr;
158+
}
159+
160+
161+
inline void FieldToMatlabAlgo::option_forceoldnames(bool value)
162+
{
163+
option_forceoldnames_ = value;
164+
}
165+
166+
inline void FieldToMatlabAlgo::option_nofieldconnectivity(bool value)
167+
{
168+
option_nofieldconnectivity_ = value;
169+
}
170+
171+
inline void FieldToMatlabAlgo::option_indexbase(int indexbase)
172+
{
173+
option_indexbase_ = indexbase;
174+
}
175+
176+
inline void FieldToMatlabAlgo::error(std::string error)
177+
{
178+
if(pr_) pr_->error(error);
179+
}
180+
181+
inline void FieldToMatlabAlgo::warning(std::string warning)
182+
{
183+
if(pr_) pr_->warning(warning);
184+
}
183185

184186

185-
} // end namespace
187+
}}
186188

187189
#endif

0 commit comments

Comments
 (0)