Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GeoModelDev
GeoModel
Commits
6f9da8b8
Commit
6f9da8b8
authored
1 year ago
by
Riccardo Maria Bianchi
Browse files
Options
Downloads
Patches
Plain Diff
comment out unused method for old DB (to be cleaned later)
parent
a986eb75
No related branches found
No related tags found
1 merge request
!332
Move R4 shapes to the new DB schema and I/O
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GeoModelIO/GeoModelRead/src/ReadGeoModel.cpp
+128
-128
128 additions, 128 deletions
GeoModelIO/GeoModelRead/src/ReadGeoModel.cpp
with
128 additions
and
128 deletions
GeoModelIO/GeoModelRead/src/ReadGeoModel.cpp
+
128
−
128
View file @
6f9da8b8
...
...
@@ -2265,135 +2265,135 @@ GeoShape* ReadGeoModel::buildShape(const unsigned int shapeId,
if
(
false
)
{
}
else
if
(
type
==
"Torus"
)
{
// Member Data:
// * Rmax - outside radius of the torus tube
// * Rmin - inside radius of the torus tube (Rmin=0 if not hollow)
// * Rtor - radius of the torus itself
// *
// * SPhi - starting angle of the segment in radians
// * DPhi - delta angle of the segment in radians
//
// shape parameters
double
Rmin
=
0.
;
double
Rmax
=
0.
;
double
Rtor
=
0.
;
double
SPhi
=
0.
;
double
DPhi
=
0.
;
// get parameters from DB string
for
(
auto
&
par
:
shapePars
)
{
std
::
vector
<
std
::
string
>
vars
=
splitString
(
par
,
'='
);
std
::
string
varName
=
vars
[
0
];
std
::
string
varValue
=
vars
[
1
];
if
(
varName
==
"Rmin"
)
Rmin
=
std
::
stod
(
varValue
);
// * SYSTEM_OF_UNITS::mm;
if
(
varName
==
"Rmax"
)
Rmax
=
std
::
stod
(
varValue
);
// * SYSTEM_OF_UNITS::mm;
if
(
varName
==
"Rtor"
)
Rtor
=
std
::
stod
(
varValue
);
// * SYSTEM_OF_UNITS::mm;
if
(
varName
==
"SPhi"
)
SPhi
=
std
::
stod
(
varValue
);
// * SYSTEM_OF_UNITS::mm;
if
(
varName
==
"DPhi"
)
DPhi
=
std
::
stod
(
varValue
);
// * SYSTEM_OF_UNITS::mm;
}
shape
=
new
GeoTorus
(
Rmin
,
Rmax
,
Rtor
,
SPhi
,
DPhi
);
}
else
if
(
type
==
"GenericTrap"
)
{
// shape parameters
double
ZHalfLength
=
0.
;
unsigned
int
NVertices
=
0
;
GeoGenericTrapVertices
Vertices
;
bool
error
=
false
;
GeoGenericTrap
*
gTrap
=
nullptr
;
std
::
string
par
;
std
::
vector
<
std
::
string
>
vars
;
std
::
string
varName
;
std
::
string
varValue
;
int
sizePars
=
shapePars
.
size
();
// check if we have more than 3 parameters
if
(
sizePars
>
3
)
{
// get the two GeoGenericTrap parameters: the ZHalfLength plus the
// number of vertices
for
(
int
it
=
0
;
it
<
2
;
it
++
)
{
par
=
shapePars
[
it
];
vars
=
splitString
(
par
,
'='
);
varName
=
vars
[
0
];
varValue
=
vars
[
1
];
// qInfo() << "vars: " << vars; // for debug only
if
(
varName
==
"ZHalfLength"
)
ZHalfLength
=
std
::
stod
(
varValue
);
if
(
varName
==
"NVertices"
)
NVertices
=
std
::
stoi
(
varValue
);
}
// and now loop over the rest of the list, to get the parameters of
// all Z planes
for
(
unsigned
it
=
2
;
it
<
NVertices
*
2
+
1
;
it
++
)
{
par
=
shapePars
[
it
];
vars
=
splitString
(
par
,
'='
);
varName
=
vars
[
0
];
varValue
=
vars
[
1
];
if
(
varName
==
"X"
)
{
double
x
=
std
::
stod
(
varValue
);
it
++
;
// go to next variable
// else if (type == "Torus") {
// // Member Data:
// // * Rmax - outside radius of the torus tube
// // * Rmin - inside radius of the torus tube (Rmin=0 if not hollow)
// // * Rtor - radius of the torus itself
// // *
// // * SPhi - starting angle of the segment in radians
// // * DPhi - delta angle of the segment in radians
// //
// // shape parameters
// double Rmin = 0.;
// double Rmax = 0.;
// double Rtor = 0.;
// double SPhi = 0.;
// double DPhi = 0.;
// // get parameters from DB string
// for (auto& par : shapePars) {
// std::vector<std::string> vars = splitString(par, '=');
// std::string varName = vars[0];
// std::string varValue = vars[1];
// if (varName == "Rmin")
// Rmin = std::stod(varValue); // * SYSTEM_OF_UNITS::mm;
// if (varName == "Rmax")
// Rmax = std::stod(varValue); // * SYSTEM_OF_UNITS::mm;
// if (varName == "Rtor")
// Rtor = std::stod(varValue); // * SYSTEM_OF_UNITS::mm;
// if (varName == "SPhi")
// SPhi = std::stod(varValue); // * SYSTEM_OF_UNITS::mm;
// if (varName == "DPhi")
// DPhi = std::stod(varValue); // * SYSTEM_OF_UNITS::mm;
// }
// shape = new GeoTorus(Rmin, Rmax, Rtor, SPhi, DPhi);
// }
// else if (type == "GenericTrap") {
// // shape parameters
// double ZHalfLength = 0.;
// unsigned int NVertices = 0;
// GeoGenericTrapVertices Vertices;
// bool error = false;
// GeoGenericTrap* gTrap = nullptr;
// std::string par;
// std::vector<std::string> vars;
// std::string varName;
// std::string varValue;
// int sizePars = shapePars.size();
// // check if we have more than 3 parameters
// if (sizePars > 3) {
// // get the two GeoGenericTrap parameters: the ZHalfLength plus the
// // number of vertices
// for (int it = 0; it < 2; it++) {
// par = shapePars[it];
// vars = splitString(par, '=');
// varName = vars[0];
// varValue = vars[1];
// // qInfo() << "vars: " << vars; // for debug only
// if (varName == "ZHalfLength") ZHalfLength = std::stod(varValue);
// if (varName == "NVertices") NVertices = std::stoi(varValue);
// }
par
=
shapePars
[
it
];
vars
=
splitString
(
par
,
'='
);
varName
=
vars
[
0
];
varValue
=
vars
[
1
];
if
(
varName
==
"Y"
)
{
double
y
=
std
::
stod
(
varValue
);
Vertices
.
push_back
(
GeoTwoVector
(
x
,
y
));
}
else
{
error
=
1
;
}
if
(
error
)
{
muxCout
.
lock
();
std
::
cout
<<
"ERROR! GeoGenericTrap 'X' and 'Y' values "
"are not at the right place! --> "
;
printStdVectorStrings
(
shapePars
);
muxCout
.
unlock
();
}
}
else
{
error
=
1
;
muxCout
.
lock
();
std
::
cout
<<
"ERROR! GeoGenericTrap 'ZPos' value is not at "
"the right place! --> "
;
printStdVectorStrings
(
shapePars
);
muxCout
.
unlock
();
}
}
if
(
error
)
{
muxCout
.
lock
();
std
::
cout
<<
"FATAL ERROR!!! - GeoGenericTrap shape error!!! "
"Aborting..."
<<
std
::
endl
;
muxCout
.
unlock
();
exit
(
EXIT_FAILURE
);
}
// build the basic GenericTrap shape
gTrap
=
new
GeoGenericTrap
(
ZHalfLength
,
Vertices
);
}
// end if (size>3)
else
{
muxCout
.
lock
();
std
::
cout
<<
"ERROR!! GeoGenericTrap has no Z vertices!! --> shape "
"input parameters: "
;
printStdVectorStrings
(
shapePars
);
muxCout
.
unlock
();
error
=
1
;
}
if
(
error
)
{
muxCout
.
lock
();
std
::
cout
<<
"FATAL ERROR!!! - GeoGenericTrap shape error!!! Aborting..."
<<
std
::
endl
;
muxCout
.
unlock
();
exit
(
EXIT_FAILURE
);
}
shape
=
gTrap
;
}
// // and now loop over the rest of the list, to get the parameters of
// // all Z planes
// for (unsigned it = 2; it < NVertices * 2 + 1; it++) {
// par = shapePars[it];
// vars = splitString(par, '=');
// varName = vars[0];
// varValue = vars[1];
// if (varName == "X") {
// double x = std::stod(varValue);
// it++; // go to next variable
// par = shapePars[it];
// vars = splitString(par, '=');
// varName = vars[0];
// varValue = vars[1];
// if (varName == "Y") {
// double y = std::stod(varValue);
// Vertices.push_back(GeoTwoVector(x, y));
// } else {
// error = 1;
// }
// if (error) {
// muxCout.lock();
// std::cout << "ERROR! GeoGenericTrap 'X' and 'Y' values "
// "are not at the right place! --> ";
// printStdVectorStrings(shapePars);
// muxCout.unlock();
// }
// } else {
// error = 1;
// muxCout.lock();
// std::cout << "ERROR! GeoGenericTrap 'ZPos' value is not at "
// "the right place! --> ";
// printStdVectorStrings(shapePars);
// muxCout.unlock();
// }
// }
// if (error) {
// muxCout.lock();
// std::cout << "FATAL ERROR!!! - GeoGenericTrap shape error!!! "
// "Aborting..."
// << std::endl;
// muxCout.unlock();
// exit(EXIT_FAILURE);
// }
// // build the basic GenericTrap shape
// gTrap = new GeoGenericTrap(ZHalfLength, Vertices);
// } // end if (size>3)
// else {
// muxCout.lock();
// std::cout << "ERROR!! GeoGenericTrap has no Z vertices!! --> shape "
// "input parameters: ";
// printStdVectorStrings(shapePars);
// muxCout.unlock();
// error = 1;
// }
// if (error) {
// muxCout.lock();
// std::cout
// << "FATAL ERROR!!! - GeoGenericTrap shape error!!! Aborting..."
// << std::endl;
// muxCout.unlock();
// exit(EXIT_FAILURE);
// }
// shape = gTrap;
// }
else
if
(
type
==
"TessellatedSolid"
)
{
// Tessellated pars example:
// "nFacets=1;TRI;vT=ABSOLUTE;nV=3;xV=0;yV=0;zV=1;xV=0;yV=1;zV=0;xV=1;yV=0;zV=0"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment