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>
72template <
typename IsTriMesh >
90 virtual ~PropertyKernel() { }
97 template <
typename T >
101 template <
typename T >
105 template <
typename T >
109 template <
typename T >
116 FPTypesHandle add_fptypes( )
117 {
return FPTypesHandle(
_add_fprop(
new GeoPTypes)); }
119 FPLengthsHandle add_fplengths( )
120 {
return FPLengthsHandle(
_add_fprop(
new GeoPLengths)); }
122 FIndicesHandle add_findices( FPTypesHandle _pht, FPLengthsHandle _phl )
124 GeoIndices *bp =
new GeoIndices( fptypes(_pht), fplengths(_phl ) );
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 ) ); }
167 GeoPTypes& fptypes( FPTypesHandle _ph )
168 {
return static_cast<GeoPTypes&
>(
_fprop(_ph) ); }
170 const GeoPTypes& fptypes( FPTypesHandle _ph )
const
171 {
return static_cast<const GeoPTypes&
>(
_fprop(_ph) ); }
174 GeoPLengths& fplengths( FPLengthsHandle _ph )
175 {
return static_cast<GeoPLengths&
>(
_fprop(_ph) ); }
177 const GeoPLengths& fplengths( FPLengthsHandle _ph )
const
178 {
return static_cast<const GeoPLengths&
>(
_fprop(_ph) ); }
181 GeoIndices& findices( FIndicesHandle _ph )
182 {
return static_cast<GeoIndices&
>(
_fprop(_ph) ); }
184 const GeoIndices& findices( FIndicesHandle _ph )
const
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&
233 fptypes( FPTypesHandle _ph,
FaceHandle _fh )
const
234 {
return fptypes( _ph )[ _fh.
idx()]; }
237 FPLengthsHandle::value_type&
238 fplengths( FPLengthsHandle _ph,
FaceHandle _fh )
239 {
return fplengths( _ph )[ _fh.
idx()]; }
241 const FPLengthsHandle::value_type&
242 fplengths( FPLengthsHandle _ph,
FaceHandle _fh )
const
243 {
return fplengths( _ph )[ _fh.
idx()]; }
246 FIndicesHandle::value_type&
247 findices( FIndicesHandle _ph,
FaceHandle _fh )
248 {
return findices( _ph )[ _fh.
idx()]; }
250 const FIndicesHandle::value_type&
251 findices( FIndicesHandle _ph,
FaceHandle _fh )
const
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;
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:64
In this namespace resides the OpenSG integration of OpenMesh.
oPropertyT< osg::GeoPTypesUI8 > GeoPTypesUI8
Adaptor for osg::GeoPTypesUI8.
Definition PropertyT.hh:281
oPropertyT< osg::GeoPLengthsUI32 > GeoPLengthsUI32
Adaptor for osg::GeoPLengthsUI32.
Definition PropertyT.hh:285
This class provides low-level property management like adding/removing properties and access to prope...
Definition BaseKernel.hh:103
virtual size_t n_vertices() const
You should not use this function directly.
Definition BaseKernel.hh:681
BaseProperty & _vprop(size_t _idx)
You should not use this function directly.
Definition BaseKernel.hh:630
BaseProperty & _fprop(size_t _idx)
You should not use this function directly.
Definition BaseKernel.hh:633
size_t _add_vprop(BaseProperty *_bp)
You should not use this function directly.
Definition BaseKernel.hh:647
virtual size_t n_edges() const
You should not use this function directly.
Definition BaseKernel.hh:683
void property_stats() const
You should not use this function directly.
Definition BaseKernel.cc:55
virtual size_t n_faces() const
You should not use this function directly.
Definition BaseKernel.hh:684
size_t _add_fprop(BaseProperty *_bp)
You should not use this function directly.
Definition BaseKernel.hh:650
int idx() const
Get the underlying index of this handle.
Definition Handles.hh:74
Handle for a vertex entity.
Definition Handles.hh:126
Handle for a face entity.
Definition Handles.hh:147
Handle representing a vertex property.
Definition Property.hh:488
Handle representing a face property.
Definition Property.hh:530
Adaptor for osg::GeoIndicesUI32.
Definition PropertyT.hh:294