49 #ifndef OPENMESH_KERNEL_OSG_PROPERTYKERNEL_HH 50 #define OPENMESH_KENREL_OSG_PROPERTYKERNEL_HH 55 #include <OpenMesh/Core/Utils/Property.hh> 56 #include <OpenMesh/Core/Mesh/BaseKernel.hh> 58 #include <OpenMesh/Tools/Kernel_OSG/PropertyT.hh> 63 namespace Kernel_OSG {
72 template <
typename IsTriMesh >
97 template <
typename T >
99 {
return VPropHandleT<T>(_add_vprop(
new typename _t2vp<T>::prop(_n))); }
101 template <
typename T >
103 {
return VPropHandleT<T>(_add_vprop(
new typename _t2vn<T>::prop(_n) )); }
105 template <
typename T >
107 {
return VPropHandleT<T>(_add_vprop(
new typename _t2vc<T>::prop(_n) )); }
109 template <
typename T >
111 {
return VPropHandleT<T>(_add_vprop(
new typename _t2vtc<T>::prop(_n) )); }
130 template <
typename T >
132 {
return static_cast<typename _t2vp<T>::prop&
>( _vprop( _ph ) ); }
134 template <
typename T >
136 {
return static_cast<const typename _t2vp<T>::prop&
>( _vprop( _ph ) ); }
139 template <
typename T >
141 {
return static_cast<typename _t2vn<T>::prop&
>( _vprop( _ph ) ); }
143 template <
typename T >
145 {
return static_cast<const typename _t2vn<T>::prop&
>( _vprop( _ph ) ); }
148 template <
typename T >
150 {
return static_cast<typename _t2vc<T>::prop&
>( _vprop( _ph ) ); }
152 template <
typename T >
154 {
return static_cast<const typename _t2vc<T>::prop&
>( _vprop( _ph ) ); }
157 template <
typename T >
159 {
return static_cast<typename _t2vtc<T>::prop&
>( _vprop( _ph ) ); }
161 template <
typename T >
162 const typename _t2vtc<T>::prop& vtexcoords(
VPropHandleT<T> _ph )
const 163 {
return static_cast<const typename _t2vtc<T>::prop&
>( _vprop( _ph ) ); }
168 {
return static_cast<GeoPTypes&>( _fprop(_ph) ); }
171 {
return static_cast<const GeoPTypes&>( _fprop(_ph) ); }
175 {
return static_cast<GeoPLengths&>( _fprop(_ph) ); }
178 {
return static_cast<const GeoPLengths&>( _fprop(_ph) ); }
182 {
return static_cast<GeoIndices&>( _fprop(_ph) ); }
185 {
return static_cast<const GeoIndices&>( _fprop(_ph) ); }
190 template <
typename T>
192 {
return vpositions(_ph)[_vh.
idx()]; }
196 {
return vpositions(_ph)[_vh.
idx()]; }
199 template <
typename T>
201 {
return vnormals(_ph)[_vh.
idx()]; }
205 {
return vnormals(_ph)[_vh.
idx()]; }
208 template <
typename T>
210 {
return vcolors(_ph)[_vh.
idx()]; }
214 {
return vcolors(_ph)[_vh.
idx()]; }
217 template <
typename T>
219 {
return vtexcoords(_ph)[_vh.
idx()]; }
223 {
return vtexcoords(_ph)[_vh.
idx()]; }
228 FPTypesHandle::value_type&
230 {
return fptypes( _ph )[ _fh.
idx()]; }
232 const FPTypesHandle::value_type&
234 {
return fptypes( _ph )[ _fh.
idx()]; }
237 FPLengthsHandle::value_type&
239 {
return fplengths( _ph )[ _fh.
idx()]; }
241 const FPLengthsHandle::value_type&
243 {
return fplengths( _ph )[ _fh.
idx()]; }
246 FIndicesHandle::value_type&
248 {
return findices( _ph )[ _fh.
idx()]; }
250 const FIndicesHandle::value_type&
252 {
return findices( _ph )[ _fh.
idx()]; }
258 std::cout <<
"#V : " << n_vertices() << std::endl;
259 std::cout <<
"#E : " << n_edges() << std::endl;
260 std::cout <<
"#F : " << n_faces() << std::endl;
270 #endif // OPENMESH_KERNEL_OSG_PROPERTYKERNEL_HH defined Adaptor for osg::GeoIndicesUI32.
Definition: PropertyT.hh:293
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
This class provides low-level property management like adding/removing properties and access to prope...
Definition: BaseKernel.hh:102
Property adaptor for OpenSG GeoProperties.
Definition: PropertyT.hh:92
Handle for a face entity.
Definition: Handles.hh:146
Handle representing a face property.
Definition: Property.hh:529
Handle representing a vertex property.
Definition: Property.hh:487
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:74
Handle for a vertex entity.
Definition: Handles.hh:125
Helper class, extending functionaliy of OpenMesh::BaseKernel to OpenSG specific property adaptors.
Definition: PropertyKernel.hh:73