Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
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
Yuhao Liu
ogs
Commits
763af87b
Commit
763af87b
authored
8 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MeL] Move common attributes / methods to base class.
parent
f1651e63
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MeshLib/PropertyVector.h
+20
-23
20 additions, 23 deletions
MeshLib/PropertyVector.h
with
20 additions
and
23 deletions
MeshLib/PropertyVector.h
+
20
−
23
View file @
763af87b
...
...
@@ -31,6 +31,23 @@ public:
std
::
vector
<
std
::
size_t
>
const
&
exclude_positions
)
const
=
0
;
virtual
~
PropertyVectorBase
()
=
default
;
MeshItemType
getMeshItemType
()
const
{
return
_mesh_item_type
;
}
std
::
string
const
&
getPropertyName
()
const
{
return
_property_name
;
}
std
::
size_t
getNumberOfComponents
()
const
{
return
_n_components
;
}
protected
:
PropertyVectorBase
(
std
::
string
const
&
property_name
,
MeshItemType
mesh_item_type
,
std
::
size_t
n_components
)
:
_n_components
(
n_components
),
_mesh_item_type
(
mesh_item_type
),
_property_name
(
property_name
)
{}
std
::
size_t
const
_n_components
;
MeshItemType
const
_mesh_item_type
;
std
::
string
const
_property_name
;
};
/// Class template PropertyVector is a std::vector with template parameter
...
...
@@ -44,13 +61,10 @@ class PropertyVector : public std::vector<PROP_VAL_TYPE>,
friend
class
Properties
;
public:
std
::
size_t
getNumberOfComponents
()
const
{
return
_n_components
;
}
std
::
size_t
getNumberOfTuples
()
const
{
return
std
::
vector
<
PROP_VAL_TYPE
>::
size
()
/
_n_components
;
}
MeshItemType
getMeshItemType
()
const
{
return
_mesh_item_type
;
}
std
::
string
const
&
getPropertyName
()
const
{
return
_property_name
;
}
PropertyVectorBase
*
clone
(
std
::
vector
<
std
::
size_t
>
const
&
exclude_positions
)
const
{
...
...
@@ -76,9 +90,7 @@ protected:
MeshItemType
mesh_item_type
,
std
::
size_t
n_components
)
:
std
::
vector
<
PROP_VAL_TYPE
>
(),
_n_components
(
n_components
),
_mesh_item_type
(
mesh_item_type
),
_property_name
(
property_name
)
PropertyVectorBase
(
property_name
,
mesh_item_type
,
n_components
)
{}
/// @brief The constructor taking meta information for the data.
...
...
@@ -93,13 +105,8 @@ protected:
MeshItemType
mesh_item_type
,
std
::
size_t
n_components
)
:
std
::
vector
<
PROP_VAL_TYPE
>
(
n_property_values
*
n_components
),
_mesh_item_type
(
mesh_item_type
),
_property_name
(
property_name
)
PropertyVectorBase
(
property_name
,
mesh_item_type
,
n_components
)
{}
std
::
size_t
const
_n_components
;
MeshItemType
const
_mesh_item_type
;
std
::
string
const
_property_name
;
};
/// Class template PropertyVector is a std::vector with template parameter
...
...
@@ -141,7 +148,6 @@ public:
_values
[
group_id
]
=
new
T
(
value
);
}
std
::
size_t
getNumberOfComponents
()
const
{
return
_n_components
;
}
std
::
size_t
getNumberOfTuples
()
const
{
return
std
::
vector
<
std
::
size_t
>::
size
();
...
...
@@ -151,8 +157,6 @@ public:
{
return
_n_components
*
std
::
vector
<
std
::
size_t
>::
size
();
}
MeshItemType
getMeshItemType
()
const
{
return
_mesh_item_type
;
}
std
::
string
const
&
getPropertyName
()
const
{
return
_property_name
;
}
PropertyVectorBase
*
clone
(
std
::
vector
<
std
::
size_t
>
const
&
exclude_positions
)
const
{
...
...
@@ -204,17 +208,10 @@ protected:
MeshItemType
mesh_item_type
,
std
::
size_t
n_components
)
:
std
::
vector
<
std
::
size_t
>
(
item2group_mapping
),
_n_components
(
n_components
),
_mesh_item_type
(
mesh_item_type
),
_property_name
(
property_name
),
PropertyVectorBase
(
property_name
,
mesh_item_type
,
n_components
),
_values
(
n_prop_groups
*
n_components
)
{}
protected
:
std
::
size_t
const
_n_components
;
MeshItemType
const
_mesh_item_type
;
std
::
string
const
_property_name
;
private
:
std
::
vector
<
T
*>
_values
;
// hide method
...
...
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