90 typedef typename Point::value_type Scalar;
93 explicit PolyLineT(
bool _closed =
false );
128 void resize(
unsigned int _n);
184 Point
position(
const Scalar _t)
const;
261 void set_to_circle(
const PointT _center,
const PointT _normal,
double _radius,
unsigned int _n_samples = 100);
270 template <
class MeshT,
class SpatialSearchT>
272 SpatialSearchT* _ssearch = 0);
284 template <
class MeshT,
class SpatialSearchT>
286 std::vector<SpatialSearchT*>* _ssearch = 0);
292 template <
class MeshT,
class SpatialSearchT>
294 SpatialSearchT &_ssearch);
302 template <
class MeshT,
class SpatialSearchT>
304 SpatialSearchT &_ssearch,
305 std::vector<PolyLineT> &out_polylines);
309 #ifdef EXTENDED_POLY_LINE
310 #include <libs/MeshIntegration/PolyLineIntegrationT.hh>
330 template <
class LineNodeT>
331 LineNodeT*
get_line_node( LineNodeT*& _line_node,
int _mode = 0);
338 template <
class LineNodeT>
360 void request_vertex_normals() { request_prop( ref_count_vnormals_ , vnormals_);}
361 void request_vertex_binormals() { request_prop( ref_count_vbinormals_ , vbinormals_);}
362 void request_vertex_colors() { request_prop( ref_count_vcolors_ , vcolors_ );}
363 void request_vertex_scalars() { request_prop( ref_count_vscalars_ , vscalars_);}
364 void request_vertex_selections() { request_prop( ref_count_vselections_, vselections_);}
365 void request_vertex_vhandles() { request_prop( ref_count_vvhandles_ , vvhandles_);}
366 void request_vertex_ehandles() { request_prop( ref_count_vehandles_ , vehandles_);}
367 void request_vertex_fhandles() { request_prop( ref_count_vfhandles_ , vfhandles_);}
369 void request_edge_normals() { request_prop( ref_count_enormals_ , enormals_);}
370 void request_edge_colors() { request_prop( ref_count_ecolors_ , ecolors_ );}
371 void request_edge_scalars() { request_prop( ref_count_escalars_ , escalars_);}
372 void request_edge_selections() { request_prop( ref_count_eselections_, eselections_);}
373 void request_preimage_directions() { request_prop( ref_count_epreimage_direction_, epreimage_direction_);}
376 void release_vertex_normals() { release_prop( ref_count_vnormals_ , vnormals_);}
377 void release_vertex_binormals() { release_prop( ref_count_vbinormals_ , vbinormals_);}
378 void release_vertex_colors() { release_prop( ref_count_vcolors_ , vcolors_ );}
379 void release_vertex_scalars() { release_prop( ref_count_vscalars_ , vscalars_);}
380 void release_vertex_selections() { release_prop( ref_count_vselections_, vselections_);}
381 void release_vertex_vhandles() { release_prop( ref_count_vvhandles_ , vvhandles_);}
382 void release_vertex_ehandles() { release_prop( ref_count_vehandles_ , vehandles_);}
383 void release_vertex_fhandles() { release_prop( ref_count_vfhandles_ , vfhandles_);}
385 void release_edge_normals() { release_prop( ref_count_enormals_ , enormals_);}
386 void release_edge_colors() { release_prop( ref_count_ecolors_ , ecolors_ );}
387 void release_edge_scalars() { release_prop( ref_count_escalars_ , escalars_);}
388 void release_edge_selections() { release_prop( ref_count_eselections_, eselections_);}
389 void release_preimage_directions() { release_prop( ref_count_epreimage_direction_, epreimage_direction_);}
392 bool vertex_normals_available()
const {
return (ref_count_vnormals_ != 0 ); }
393 bool vertex_binormals_available()
const {
return (ref_count_vbinormals_ != 0 ); }
394 bool vertex_colors_available()
const {
return (ref_count_vcolors_ != 0 ); }
395 bool vertex_scalars_available()
const {
return (ref_count_vscalars_ != 0 ); }
396 bool vertex_selections_available()
const {
return (ref_count_vselections_ != 0 ); }
397 bool vertex_vhandles_available()
const {
return (ref_count_vvhandles_ != 0 ); }
398 bool vertex_ehandles_available()
const {
return (ref_count_vehandles_ != 0 ); }
399 bool vertex_fhandles_available()
const {
return (ref_count_vfhandles_ != 0 ); }
401 bool edge_normals_available()
const {
return (ref_count_enormals_ != 0 ); }
402 bool edge_colors_available()
const {
return (ref_count_ecolors_ != 0 ); }
403 bool edge_scalars_available()
const {
return (ref_count_escalars_ != 0 ); }
404 bool edge_selections_available()
const {
return (ref_count_eselections_ != 0 ); }
405 bool edge_preimage_directions_available()
const {
return (ref_count_epreimage_direction_ != 0 ); }
408 Point& vertex_normal(
unsigned int _i) {
return vnormals_[_i];}
409 const Point& vertex_normal(
unsigned int _i)
const {
return vnormals_[_i];}
411 Point& vertex_binormal(
unsigned int _i) {
return vbinormals_[_i];}
412 const Point& vertex_binormal(
unsigned int _i)
const {
return vbinormals_[_i];}
414 Point & vertex_color(
unsigned int _i) {
return vcolors_[_i];}
415 const Point & vertex_color(
unsigned int _i)
const {
return vcolors_[_i];}
417 Scalar& vertex_scalar(
unsigned int _i) {
return vscalars_[_i];}
418 const Scalar& vertex_scalar(
unsigned int _i)
const {
return vscalars_[_i];}
420 unsigned char& vertex_selection(
unsigned int _i) {
return vselections_[_i];}
421 const unsigned char& vertex_selection(
unsigned int _i)
const {
return vselections_[_i];}
423 int& vertex_vhandle(
unsigned int _i) {
return vvhandles_[_i];}
424 const int& vertex_vhandle(
unsigned int _i)
const {
return vvhandles_[_i];}
426 int& vertex_ehandle(
unsigned int _i) {
return vehandles_[_i];}
427 const int& vertex_ehandle(
unsigned int _i)
const {
return vehandles_[_i];}
429 int& vertex_fhandle(
unsigned int _i) {
return vfhandles_[_i];}
430 const int& vertex_fhandle(
unsigned int _i)
const {
return vfhandles_[_i];}
432 Point& edge_normal(
unsigned int _i) {
return enormals_[_i];}
433 const Point& edge_normal(
unsigned int _i)
const {
return enormals_[_i];}
435 Point & edge_color(
unsigned int _i) {
return ecolors_[_i];}
436 const Point & edge_color(
unsigned int _i)
const {
return ecolors_[_i];}
438 Scalar& edge_scalar(
unsigned int _i) {
return escalars_[_i];}
439 const Scalar& edge_scalar(
unsigned int _i)
const {
return escalars_[_i];}
441 unsigned char& edge_selection(
unsigned int _i) {
return eselections_[_i];}
442 const unsigned char& edge_selection(
unsigned int _i)
const {
return eselections_[_i];}
444 Point & preimage_direction(
unsigned int _i) {
return epreimage_direction_[_i];}
445 const Point & preimage_direction(
unsigned int _i)
const {
return epreimage_direction_[_i];}
488 typedef int CustomPropertyHandle;
491 CustomPropertyHandle request_custom_property(
const std::string& _name,
unsigned int _prop_size);
494 void release_custom_property(
const std::string& _name);
495 void release_custom_property(CustomPropertyHandle _prop_handle);
498 bool custom_property_available(CustomPropertyHandle _property_handle)
const;
499 bool custom_property_available(
const std::string& _name)
const;
502 void set_custom_property(CustomPropertyHandle _property_handle,
unsigned int _vertex,
const void* _data);
503 void get_custom_property(CustomPropertyHandle _property_handle,
unsigned int _vertex,
void* _dst)
const;
506 void set_custom_property(
const std::string& _name,
unsigned int _vertex,
const void* _data);
507 void get_custom_property(
const std::string& _name,
unsigned int _vertex,
void* _dst)
const;
537 CustomPropertyHandle get_custom_property_handle(
const std::string& _name)
const;
540 const std::string get_custom_property_name(CustomPropertyHandle _property_handle)
const;
543 unsigned int get_num_custom_properties()
const;
546 const void* get_custom_property_buffer(CustomPropertyHandle _property_handle)
const;
550 CustomPropertyHandle enumerate_custom_property_handles(
unsigned int _i)
const;
555 bool vertex_selected(
unsigned int _i) {
return (_i < vselections_.size() ? vertex_selection(_i) == 1 : false); }
556 bool edge_selected(
unsigned int _i) {
return (_i < eselections_.size() ? edge_selection(_i) == 1 : false); }
558 void select_vertex(
unsigned int _i) {
if(_i < vselections_.size()) vertex_selection(_i) = 1; }
559 void select_edge(
unsigned int _i) {
if(_i < eselections_.size()) edge_selection(_i) = 1; }
561 void deselect_vertex(
unsigned int _i) {
if(_i < vselections_.size()) vertex_selection(_i) = 0; }
562 void deselect_edge(
unsigned int _i) {
if(_i < eselections_.size()) edge_selection(_i) = 0; }
568 void copy_vertex_complete(
const PolyLineT<PointT>& _pl,
unsigned int _i,
unsigned int _j);
572 void copy_edge_complete(
const PolyLineT<PointT>& _pl,
unsigned int _i,
unsigned int _j);
585 template <
class MeshT,
class SpatialSearchT>
588 typename MeshT::FaceHandle &_fh,
589 SpatialSearchT * _ssearch = 0,
597 template<
class MeshT,
class SpatialSearchT>
603 SpatialSearchT &_ssearch);
609 template <
class MeshT>
616 template <
class PropT>
617 void request_prop(
unsigned int& _ref_count, PropT& _prop);
618 template <
class PropT>
619 void release_prop(
unsigned int& _ref_count, PropT& _prop);
630 template <
class IPo
int>
632 const IPoint& _n_plane,
637 template<
class MeshT>
638 void edge_points_in_segment(
const MeshT& _mesh,
641 const typename MeshT::FaceHandle& _fh0,
642 const typename MeshT::FaceHandle& _fh1,
643 std::vector<Point> & _points,
644 std::vector<typename MeshT::EdgeHandle>& _ehandles );
664 std::vector<Point> vnormals_;
665 std::vector<Point> vbinormals_;
666 std::vector<Point> vcolors_;
667 std::vector<Scalar> vscalars_;
668 std::vector<unsigned char> vselections_;
669 std::vector<int> vvhandles_;
670 std::vector<int> vehandles_;
671 std::vector<int> vfhandles_;
673 std::vector<Point> enormals_;
674 std::vector<Point> ecolors_;
675 std::vector<Scalar> escalars_;
676 std::vector<unsigned char> eselections_;
677 std::vector<Point> epreimage_direction_;
681 unsigned int ref_count_vnormals_;
682 unsigned int ref_count_vbinormals_;
683 unsigned int ref_count_vcolors_;
684 unsigned int ref_count_vscalars_;
685 unsigned int ref_count_vselections_;
686 unsigned int ref_count_vvhandles_;
687 unsigned int ref_count_vehandles_;
688 unsigned int ref_count_vfhandles_;
690 unsigned int ref_count_enormals_;
691 unsigned int ref_count_ecolors_;
692 unsigned int ref_count_escalars_;
693 unsigned int ref_count_eselections_;
694 unsigned int ref_count_epreimage_direction_;
705 unsigned int prop_size;
708 std::vector<char> prop_data;
711 unsigned int datatype;
714 std::string shader_binding;
716 char* buffer() {
return prop_data.empty() ? 0 : &prop_data[0];}
717 const char* buffer()
const {
return prop_data.empty() ? 0 : &prop_data[0];}
720 typedef std::map< std::string, CustomProperty* > CustomPropertyMap;
723 const CustomProperty* custom_prop(CustomPropertyHandle _handle)
const;
725 CustomPropertyHandle custom_prop_handle(
const CustomProperty*)
const;
728 CustomPropertyMap custom_properties;
731 std::vector<CustomProperty*> cprop_enum;