Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Service Desk
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
MostafaMollaali
dynamic
Commits
893f8c10
Commit
893f8c10
authored
6 years ago
by
Dmitri Naumov
Browse files
Options
Downloads
Patches
Plain Diff
[A] Remove unused ProjectData interface.
Similar functions used by DE are in the DataHolderLib/Project.
parent
060fcce9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/ApplicationsLib/ProjectData.cpp
+0
-86
0 additions, 86 deletions
Applications/ApplicationsLib/ProjectData.cpp
Applications/ApplicationsLib/ProjectData.h
+0
-35
0 additions, 35 deletions
Applications/ApplicationsLib/ProjectData.h
with
0 additions
and
121 deletions
Applications/ApplicationsLib/ProjectData.cpp
+
0
−
86
View file @
893f8c10
...
...
@@ -181,92 +181,6 @@ ProjectData::~ProjectData()
delete
m
;
}
void
ProjectData
::
addMesh
(
MeshLib
::
Mesh
*
mesh
)
{
std
::
string
name
=
mesh
->
getName
();
isMeshNameUniqueAndProvideUniqueName
(
name
);
mesh
->
setName
(
name
);
_mesh_vec
.
push_back
(
mesh
);
}
std
::
vector
<
MeshLib
::
Mesh
*>::
const_iterator
ProjectData
::
findMeshByName
(
std
::
string
const
&
name
)
const
{
return
const_cast
<
ProjectData
&>
(
*
this
).
findMeshByName
(
name
);
}
std
::
vector
<
MeshLib
::
Mesh
*>::
iterator
ProjectData
::
findMeshByName
(
std
::
string
const
&
name
)
{
return
std
::
find_if
(
_mesh_vec
.
begin
(),
_mesh_vec
.
end
(),
[
&
name
](
MeshLib
::
Mesh
*
mesh
)
{
return
mesh
&&
(
name
==
mesh
->
getName
());
});
}
const
MeshLib
::
Mesh
*
ProjectData
::
getMesh
(
const
std
::
string
&
name
)
const
{
auto
it
=
findMeshByName
(
name
);
return
(
it
==
_mesh_vec
.
end
()
?
nullptr
:
*
it
);
}
bool
ProjectData
::
removeMesh
(
const
std
::
string
&
name
)
{
bool
mesh_found
=
false
;
auto
it
=
findMeshByName
(
name
);
while
(
it
!=
_mesh_vec
.
end
())
{
delete
*
it
;
*
it
=
nullptr
;
it
=
findMeshByName
(
name
);
mesh_found
=
true
;
}
_mesh_vec
.
erase
(
std
::
remove
(
_mesh_vec
.
begin
(),
_mesh_vec
.
end
(),
nullptr
),
_mesh_vec
.
end
());
return
mesh_found
;
}
bool
ProjectData
::
meshExists
(
const
std
::
string
&
name
)
const
{
return
findMeshByName
(
name
)
!=
_mesh_vec
.
end
();
}
bool
ProjectData
::
isMeshNameUniqueAndProvideUniqueName
(
std
::
string
&
name
)
const
{
int
count
(
0
);
bool
isUnique
(
false
);
std
::
string
cpName
;
while
(
!
isUnique
)
{
isUnique
=
true
;
cpName
=
name
;
count
++
;
// If the original name already exists we start to add numbers to name
// for
// as long as it takes to make the name unique.
if
(
count
>
1
)
cpName
=
cpName
+
"-"
+
std
::
to_string
(
count
);
for
(
auto
mesh
:
_mesh_vec
)
if
(
cpName
==
mesh
->
getName
())
isUnique
=
false
;
}
// At this point cpName is a unique name and isUnique is true.
// If cpName is not the original name, "name" is changed and isUnique is set
// to false,
// indicating that a vector with the original name already exists.
if
(
count
>
1
)
{
isUnique
=
false
;
name
=
cpName
;
}
return
isUnique
;
}
void
ProjectData
::
parseProcessVariables
(
BaseLib
::
ConfigTree
const
&
process_variables_config
)
{
...
...
This diff is collapsed.
Click to expand it.
Applications/ApplicationsLib/ProjectData.h
+
0
−
35
View file @
893f8c10
...
...
@@ -75,27 +75,6 @@ public:
/// Returns the GEOObjects containing all points, polylines and surfaces.
GeoLib
::
GEOObjects
*
getGEOObjects
()
{
return
_geoObjects
;
}
/// Adds a new mesh under a (possibly new) unique name.
/// \attention This might change the given mesh's name.
void
addMesh
(
MeshLib
::
Mesh
*
mesh
);
/// Returns the mesh with the given name or a \c nullptr if the mesh was not
/// found.
const
MeshLib
::
Mesh
*
getMesh
(
const
std
::
string
&
name
)
const
;
/// Returns all the meshes with their respective names
/// \attention This method should be used only by methods garanteeing
/// read-only access to the meshes.
/// \todo This method breaks encapsulation.
const
std
::
vector
<
MeshLib
::
Mesh
*>&
getMeshObjects
()
const
{
return
_mesh_vec
;
}
/// Deletes all meshes with the given name and removes them from the list of
/// saved meshes. If any mesh was found for removal, true is returned and
/// false otherwise.
bool
removeMesh
(
const
std
::
string
&
name
);
//
// Process interface
...
...
@@ -110,20 +89,6 @@ public:
TimeLoop
&
getTimeLoop
()
{
return
*
_time_loop
;
}
private
:
/// Checks if a mesh with the same name exists and provides a unique name in
/// case of already existing mesh. Returns true if the mesh name is unique.
/// Returns false and changes the provided name to a unique name otherwise.
bool
isMeshNameUniqueAndProvideUniqueName
(
std
::
string
&
name
)
const
;
/// Returns true if a mesh with the same name exists and false otherwise.
bool
meshExists
(
const
std
::
string
&
name
)
const
;
/// Returns an iterator to the first found mesh with the given name.
std
::
vector
<
MeshLib
::
Mesh
*>::
const_iterator
findMeshByName
(
std
::
string
const
&
name
)
const
;
std
::
vector
<
MeshLib
::
Mesh
*>::
iterator
findMeshByName
(
std
::
string
const
&
name
);
/// Parses the process variables configuration and creates new variables for
/// each variable entry passing the corresponding subtree to the process
/// variable constructor.
...
...
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