opensurgsim
ParticlesShape-inl.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013-2016, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef SURGSIM_MATH_PARTICLESSHAPE_INL_H
18 #define SURGSIM_MATH_PARTICLESSHAPE_INL_H
19 
20 namespace SurgSim
21 {
22 namespace Math
23 {
24 
25 template <class V>
27  DataStructures::Vertices<DataStructures::EmptyData>(other),
28  m_radius(0.0)
29 {
30  SURGSIM_ADD_SERIALIZABLE_PROPERTY(ParticlesShape, double, Radius, getRadius, setRadius);
31  setInitialVertices(*this);
32  update();
33 }
34 
35 template <class V>
37 {
39  setInitialVertices(*this);
40  update();
41  return *this;
42 }
43 
44 
45 }; // namespace Math
46 }; // namespace SurgSim
47 
48 #endif
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Vertices< VertexData > & operator=(const Vertices< V > &other)
Assignment when the template data is a different type In this case, no data will be copied...
Definition: Vertices-inl.h:47
bool update()
Performs any updates that are required when the vertices are modified.
Definition: Vertices-inl.h:86
ParticlesShape & operator=(const Vertices< V > &other)
Assignment when the template data is a different type.
double getRadius() const
Get the radius of the particles.
Definition: ParticlesShape.cpp:73
void setRadius(double radius)
Set the particles&#39; radius.
Definition: ParticlesShape.cpp:78
void setInitialVertices(const DataStructures::Vertices< DataStructures::EmptyData > &vertices)
Set the initial Vertices.
Definition: VerticesShape.cpp:28
ParticlesShape(double radius=0.0)
Constructor.
Definition: ParticlesShape.cpp:29
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:51
Particles Shape: A shape consisting of a group of particles of equal radius.
Definition: ParticlesShape.h:42