Developer Documentation
MeshObjectInfoScripting.cc
1/*===========================================================================*\
2* *
3* OpenFlipper *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openflipper.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenFlipper. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39* *
40\*===========================================================================*/
41
42
43
44#include "MeshObjectInfoPlugin.hh"
45
46#include <MeshTools/MeshInfoT.hh>
47
48
49//------------------------------------------------------------------------------
50
55
56 emit setSlotDescription("vertexCount(int)",tr("get total number of vertices for a given object"),
57 QStringList(tr("objectID")), QStringList(tr("id of an object")));
58
59 emit setSlotDescription("edgeCount(int)",tr("get total number of edges for a given object"),
60 QStringList(tr("objectID")), QStringList(tr("id of an object")));
61
62 emit setSlotDescription("faceCount(int)",tr("get total number of faces for a given object"),
63 QStringList(tr("objectID")), QStringList(tr("id of an object")));
64
65 emit setSlotDescription("boundaryCount(int)",tr("get number of boundaries for a given object"),
66 QStringList(tr("objectID")), QStringList(tr("id of an object")));
67
68 emit setSlotDescription("componentCount(int)",tr("get number of components for a given object"),
69 QStringList(tr("objectID")), QStringList(tr("id of an object")));
70
71 emit setSlotDescription("genus(int)",tr("get the genus of a given object"),
72 QStringList(tr("objectID")), QStringList(tr("id of an object")));
73
74 emit setSlotDescription("cog(int)",tr("get the center of gravity for a given object"),
75 QStringList(tr("objectID")), QStringList(tr("id of an object")));
76
77 emit setSlotDescription("boundingBoxMin(int)",tr("get minimum point of the axis-aligned bounding box"),
78 QStringList(tr("objectID")), QStringList(tr("id of an object")));
79
80 emit setSlotDescription("boundingBoxMax(int)",tr("get maximum point of the axis-aligned bounding box"),
81 QStringList(tr("objectID")), QStringList(tr("id of an object")));
82
83 emit setSlotDescription("boundingBoxSize(int)",tr("get the size of the axis-aligned bounding box"),
84 QStringList(tr("objectID")), QStringList(tr("id of an object")));
85
86
87 emit setSlotDescription("edgeLength(int,int)",tr("Get the length of an edge"),
88 QString(tr("ObjectId,EdgeHandle")).split(","),
89 QString(tr("id of the object, handle of an edge")).split(","));
90
91 emit setSlotDescription("faceArea(int,int)",tr("Get the area of a face"),
92 QString(tr("ObjectId,FaceHandle")).split(","),
93 QString(tr("id of the object, handle of a face")).split(","));
94
95 emit setSlotDescription("aspectRatio(int,int)",tr("Get the aspect ratio of a face"),
96 QString(tr("ObjectId,FaceHandle")).split(","),
97 QString(tr("id of the object, handle of a face")).split(","));
98
99 emit setSlotDescription("vertexValence(int,int)",tr("Get the valence of a vertex"),
100 QString(tr("ObjectId,VertexHandle")).split(","),
101 QString(tr("id of the object, handle of a vertex")).split(","));
102
103 emit setSlotDescription("minEdgeLength(int)",tr("Get the minimal edge length of an object"),
104 QStringList(tr("ObjectId")), QStringList(tr("id of the object")));
105
106 emit setSlotDescription("maxEdgeLength(int)",tr("Get the maximal edge length of an object"),
107 QStringList(tr("ObjectId")), QStringList(tr("id of the object")));
108
109 emit setSlotDescription("meanEdgeLength(int)",tr("Get the mean edge length of an object"),
110 QStringList(tr("ObjectId")), QStringList(tr("id of the object")));
111
112}
113
114
115//------------------------------------------------------------------------------
116
123{
124
125 BaseObjectData* object;
126 if ( ! PluginFunctions::getObject(_id,object) )
127 return -1;
128
129 if ( object == 0){
130 emit log(LOGERR, tr("Unable to get object"));
131 return -1;
132 }
133
134 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
135 TriMesh* mesh = PluginFunctions::triMesh(object);
136
137 if ( mesh == 0 ) {
138 emit log(LOGERR, tr("Unable to get mesh"));
139 return -1;
140 }
141
142 return mesh->n_vertices();
143
144 } else {
145 PolyMesh* mesh = PluginFunctions::polyMesh(object);
146
147 if ( mesh == 0 ) {
148 emit log(LOGERR, tr("Unable to get mesh"));
149 return -1;
150 }
151
152 return mesh->n_vertices();
153 }
154}
155
156
157//------------------------------------------------------------------------------
158
165{
166
167 BaseObjectData* object;
168 if ( ! PluginFunctions::getObject(_id,object) )
169 return -1;
170
171 if ( object == 0){
172 emit log(LOGERR, tr("Unable to get object"));
173 return -1;
174 }
175
176 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
177 TriMesh* mesh = PluginFunctions::triMesh(object);
178
179 if ( mesh == 0 ) {
180 emit log(LOGERR, tr("Unable to get mesh"));
181 return -1;
182 }
183
184 return mesh->n_edges();
185
186 } else {
187 PolyMesh* mesh = PluginFunctions::polyMesh(object);
188
189 if ( mesh == 0 ) {
190 emit log(LOGERR, tr("Unable to get mesh"));
191 return -1;
192 }
193
194 return mesh->n_edges();
195 }
196}
197
198
199//------------------------------------------------------------------------------
200
207{
208
209 BaseObjectData* object;
210 if ( ! PluginFunctions::getObject(_id,object) )
211 return -1;
212
213 if ( object == 0){
214 emit log(LOGERR, tr("Unable to get object"));
215 return -1;
216 }
217
218 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
219 TriMesh* mesh = PluginFunctions::triMesh(object);
220
221 if ( mesh == 0 ) {
222 emit log(LOGERR, tr("Unable to get mesh"));
223 return -1;
224 }
225
226 return mesh->n_faces();
227
228 } else {
229 PolyMesh* mesh = PluginFunctions::polyMesh(object);
230
231 if ( mesh == 0 ) {
232 emit log(LOGERR, tr("Unable to get mesh"));
233 return -1;
234 }
235
236 return mesh->n_faces();
237 }
238}
239
240
241//------------------------------------------------------------------------------
242
249{
250
251 BaseObjectData* object;
252 if ( ! PluginFunctions::getObject(_id,object) )
253 return -1;
254
255 if ( object == 0){
256 emit log(LOGERR, tr("Unable to get object"));
257 return -1;
258 }
259
260 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
261 TriMesh* mesh = PluginFunctions::triMesh(object);
262
263 if ( mesh == 0 ) {
264 emit log(LOGERR, tr("Unable to get mesh"));
265 return -1;
266 }
267
268 return MeshInfo::boundaryCount(mesh);
269
270 } else {
271 PolyMesh* mesh = PluginFunctions::polyMesh(object);
272
273 if ( mesh == 0 ) {
274 emit log(LOGERR, tr("Unable to get mesh"));
275 return -1;
276 }
277
278 return MeshInfo::boundaryCount(mesh);
279 }
280}
281
282
283//------------------------------------------------------------------------------
284
291{
292
293 BaseObjectData* object;
294 if ( ! PluginFunctions::getObject(_id,object) )
295 return -1;
296
297 if ( object == 0){
298 emit log(LOGERR, tr("Unable to get object"));
299 return -1;
300 }
301
302 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
303 TriMesh* mesh = PluginFunctions::triMesh(object);
304
305 if ( mesh == 0 ) {
306 emit log(LOGERR, tr("Unable to get mesh"));
307 return -1;
308 }
309
310 return MeshInfo::componentCount(mesh);
311
312 } else {
313 PolyMesh* mesh = PluginFunctions::polyMesh(object);
314
315 if ( mesh == 0 ) {
316 emit log(LOGERR, tr("Unable to get mesh"));
317 return -1;
318 }
319
320 return MeshInfo::componentCount(mesh);
321 }
322}
323
324
325//------------------------------------------------------------------------------
326
333{
334
335 BaseObjectData* object;
336 if ( ! PluginFunctions::getObject(_id,object) )
337 return -1;
338
339 if ( object == 0){
340 emit log(LOGERR, tr("Unable to get object"));
341 return -1;
342 }
343
344 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
345 TriMesh* mesh = PluginFunctions::triMesh(object);
346
347 if ( mesh == 0 ) {
348 emit log(LOGERR, tr("Unable to get mesh"));
349 return -1;
350 }
352 return (1 - (mesh->n_vertices() - mesh->n_edges() + mesh->n_faces() ) / 2);
353
354 } else {
355 PolyMesh* mesh = PluginFunctions::polyMesh(object);
356
357 if ( mesh == 0 ) {
358 emit log(LOGERR, tr("Unable to get mesh"));
359 return -1;
360 }
361
362 return (1 - (mesh->n_vertices() - mesh->n_edges() + mesh->n_faces() ) / 2);
363 }
364}
365
366
367//------------------------------------------------------------------------------
368
375{
376
377 BaseObjectData* object;
378 if ( ! PluginFunctions::getObject(_id,object) )
379 return Vector();
380
381 if ( object == 0){
382 emit log(LOGERR, tr("Unable to get object"));
383 return Vector();
384 }
385
386 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
387 TriMesh* mesh = PluginFunctions::triMesh(object);
388
389 if ( mesh == 0 ) {
390 emit log(LOGERR, tr("Unable to get mesh"));
391 return Vector();
392 }
393
394 return MeshInfo::cog(mesh);
395
396 } else {
397 PolyMesh* mesh = PluginFunctions::polyMesh(object);
398
399 if ( mesh == 0 ) {
400 emit log(LOGERR, tr("Unable to get mesh"));
401 return Vector();
402 }
403
404 return MeshInfo::cog(mesh);
405 }
406}
407
408
409//------------------------------------------------------------------------------
410
417{
418
419 BaseObjectData* object;
420 if ( ! PluginFunctions::getObject(_id,object) )
421 return Vector();
422
423 if ( object == 0){
424 emit log(LOGERR, tr("Unable to get object"));
425 return Vector();
426 }
427
428 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
429 TriMesh* mesh = PluginFunctions::triMesh(object);
430
431 if ( mesh == 0 ) {
432 emit log(LOGERR, tr("Unable to get mesh"));
433 return Vector();
434 }
435
436 ACG::Vec3d min;
437 ACG::Vec3d max;
438 MeshInfo::getBoundingBox(mesh, min, max);
439
440 return min;
441
442 } else {
443 PolyMesh* mesh = PluginFunctions::polyMesh(object);
444
445 if ( mesh == 0 ) {
446 emit log(LOGERR, tr("Unable to get mesh"));
447 return Vector();
448 }
449
450 ACG::Vec3d min;
451 ACG::Vec3d max;
452 MeshInfo::getBoundingBox(mesh, min, max);
453
454 return min;
455 }
456}
457
458
459//------------------------------------------------------------------------------
460
467{
468
469 BaseObjectData* object;
470 if ( ! PluginFunctions::getObject(_id,object) )
471 return Vector();
472
473 if ( object == 0){
474 emit log(LOGERR, tr("Unable to get object"));
475 return Vector();
476 }
477
478 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
479 TriMesh* mesh = PluginFunctions::triMesh(object);
480
481 if ( mesh == 0 ) {
482 emit log(LOGERR, tr("Unable to get mesh"));
483 return Vector();
484 }
485
486 ACG::Vec3d min;
487 ACG::Vec3d max;
488 MeshInfo::getBoundingBox(mesh, min, max);
489
490 return max;
491
492 } else {
493 PolyMesh* mesh = PluginFunctions::polyMesh(object);
494
495 if ( mesh == 0 ) {
496 emit log(LOGERR, tr("Unable to get mesh"));
497 return Vector();
498 }
499
500 ACG::Vec3d min;
501 ACG::Vec3d max;
502 MeshInfo::getBoundingBox(mesh, min, max);
503
504 return max;
505 }
506}
507
508
509//------------------------------------------------------------------------------
510
517{
518
519 BaseObjectData* object;
520 if ( ! PluginFunctions::getObject(_id,object) )
521 return Vector();
522
523 if ( object == 0){
524 emit log(LOGERR, tr("Unable to get object"));
525 return Vector();
526 }
527
528 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
529 TriMesh* mesh = PluginFunctions::triMesh(object);
530
531 if ( mesh == 0 ) {
532 emit log(LOGERR, tr("Unable to get mesh"));
533 return Vector();
534 }
535
536 ACG::Vec3d min;
537 ACG::Vec3d max;
538 MeshInfo::getBoundingBox(mesh, min, max);
539
540 return (max - min);
541
542 } else {
543 PolyMesh* mesh = PluginFunctions::polyMesh(object);
544
545 if ( mesh == 0 ) {
546 emit log(LOGERR, tr("Unable to get mesh"));
547 return Vector();
548 }
549
550 ACG::Vec3d min;
551 ACG::Vec3d max;
552 MeshInfo::getBoundingBox(mesh, min, max);
553
554 return (max - min);
555 }
556}
557
558
559//------------------------------------------------------------------------------
560
567double InfoMeshObjectPlugin::edgeLength(int _id, int _edgeHandle)
568{
569
570 BaseObjectData* object;
571 if ( ! PluginFunctions::getObject(_id,object) )
572 return -1.0;
573
574 if ( object == 0){
575 emit log(LOGERR, tr("Unable to get object"));
576 return -1.0;
577 }
578
579 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
580 TriMesh* mesh = PluginFunctions::triMesh(object);
581
582 if ( mesh == 0 ) {
583 emit log(LOGERR, tr("Unable to get mesh"));
584 return -1.0;
585 }
586
587 OpenMesh::SmartEdgeHandle eh( _edgeHandle,mesh );
588
589 if ( !eh.is_valid() ) {
590 emit log(LOGERR,tr("Unable to get edge handle"));
591 return -1.0;
592 }
593
595 TriMesh::Point p0 = mesh->point( hh.from() );
596 TriMesh::Point p1 = mesh->point( hh.to() );
597
598 return (p0 - p1).norm();
599
600 } else {
601 PolyMesh* mesh = PluginFunctions::polyMesh(object);
602
603 if ( mesh == 0 ) {
604 emit log(LOGERR, tr("Unable to get mesh"));
605 return -1.0;
606 }
607
608 OpenMesh::SmartEdgeHandle eh( _edgeHandle ,mesh);
609
610 if ( !eh.is_valid() ) {
611 emit log(LOGERR,tr("Unable to get edge handle"));
612 return -1.0;
613 }
614
616 PolyMesh::Point p0 = mesh->point( hh.from() );
617 PolyMesh::Point p1 = mesh->point( hh.to() );
618
619 return (p0 - p1).norm();
620 }
621}
622
623
624//------------------------------------------------------------------------------
625
632double InfoMeshObjectPlugin::faceArea(int _id, int _faceHandle)
633{
634
635 BaseObjectData* object;
636 if ( ! PluginFunctions::getObject(_id,object) )
637 return -1.0;
638
639 if ( object == 0){
640 emit log(LOGERR, tr("Unable to get object"));
641 return -1.0;
642 }
643
644 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
645 TriMesh* mesh = PluginFunctions::triMesh(object);
646
647 if ( mesh == 0 ) {
648 emit log(LOGERR, tr("Unable to get mesh"));
649 return -1.0;
650 }
651
652 TriMesh::FaceHandle fh( _faceHandle );
653
654 if ( !fh.is_valid() ) {
655 emit log(LOGERR,tr("Unable to get face handle"));
656 return -1.0;
657 }
658
659 TriMesh::FaceVertexIter fv_it = mesh->fv_iter(fh);
660
661 TriMesh::Point v0 = mesh->point( *fv_it );
662 ++fv_it;
663 TriMesh::Point v1 = mesh->point( *fv_it );
664 ++fv_it;
665 TriMesh::Point v2 = mesh->point( *fv_it );
666
667 return ACG::Geometry::triangleArea( v0, v1, v2 );
668
669 } else {
670 PolyMesh* mesh = PluginFunctions::polyMesh(object);
671
672 if ( mesh == 0 ) {
673 emit log(LOGERR, tr("Unable to get mesh"));
674 return -1.0;
675 }
676
677 OpenMesh::SmartFaceHandle fh( _faceHandle ,mesh);
678
679 if ( !fh.is_valid() ) {
680 emit log(LOGERR,tr("Unable to get face handle"));
681 return -1.0;
682 }
683
684 std::vector< PolyMesh::Point > vertices;
685
686 for (auto fv_it : fh.vertices())
687 vertices.push_back( mesh->point( fv_it ) );
688
690 emit log(LOGERR,tr("Not implemented yet"));
691 return -1.0;
692// return ACG::Geometry::polygonArea( vertices );
693 }
694}
695
696
697//------------------------------------------------------------------------------
698
705double InfoMeshObjectPlugin::aspectRatio(int _id, int _faceHandle)
706{
707
708 BaseObjectData* object;
709 if ( ! PluginFunctions::getObject(_id,object) )
710 return -1.0;
711
712 if ( object == 0){
713 emit log(LOGERR, tr("Unable to get object"));
714 return -1.0;
715 }
716
717 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
718 TriMesh* mesh = PluginFunctions::triMesh(object);
719
720 if ( mesh == 0 ) {
721 emit log(LOGERR, tr("Unable to get mesh"));
722 return -1.0;
723 }
724
725 TriMesh::FaceHandle fh( _faceHandle );
726
727 if ( !fh.is_valid() ) {
728 emit log(LOGERR,tr("Unable to get face handle"));
729 return -1.0;
730 }
731
732 TriMesh::FaceVertexIter fv_it = mesh->fv_iter(fh);
733
734 TriMesh::Point v0 = mesh->point( *fv_it );
735 ++fv_it;
736 TriMesh::Point v1 = mesh->point( *fv_it );
737 ++fv_it;
738 TriMesh::Point v2 = mesh->point( *fv_it );
739
740 return ACG::Geometry::aspectRatio( v0, v1, v2 );
741
742 } else {
743
744 emit log(LOGERR,tr("Aspect ratio can only be calculated for triangle meshes"));
745 return -1.0;
746 }
747}
748
749
750//------------------------------------------------------------------------------
751
758int InfoMeshObjectPlugin::vertexValence (int _id, int _vertexHandle)
759{
760
761 BaseObjectData* object;
762 if ( ! PluginFunctions::getObject(_id,object) )
763 return -1;
764
765 if ( object == 0){
766 emit log(LOGERR, tr("Unable to get object"));
767 return -1;
768 }
769
770 if ( object->dataType(DATA_TRIANGLE_MESH) ) {
771 TriMesh* mesh = PluginFunctions::triMesh(object);
772
773 if ( mesh == 0 ) {
774 emit log(LOGERR, tr("Unable to get mesh"));
775 return -1;
776 }
777
778 OpenMesh::SmartVertexHandle vh( _vertexHandle ,mesh);
779
780 if ( !vh.is_valid() ) {
781 emit log(LOGERR,tr("Unable to get vertex handle"));
782 return -1;
783 }
784
785 //check valence
786 int valence = 0;
787
788 for (auto vv_it : vh.vertices())
789 valence++;
790
791 return valence;
792
793 } else {
794 PolyMesh* mesh = PluginFunctions::polyMesh(object);
795
796 if ( mesh == 0 ) {
797 emit log(LOGERR, tr("Unable to get mesh"));
798 return -1;
799 }
800
801 OpenMesh::SmartVertexHandle vh( _vertexHandle ,mesh);
802
803 if ( !vh.is_valid() ) {
804 emit log(LOGERR,tr("Unable to get vertex handle"));
805 return -1;
806 }
807
808 //check valence
809 int valence = 0;
810
811 for (auto vv_it : vh.vertices())
812 valence++;
813
814 return valence;
815 }
816}
817
818//------------------------------------------------------------------------------
819
826{
827 double min, max, mean;
828
829 if (getEdgeLengths (_id, min, max, mean))
830 return min;
831 else
832 return -1;
833}
834
835//------------------------------------------------------------------------------
836
843{
844 double min, max, mean;
845
846 if (getEdgeLengths (_id, min, max, mean))
847 return max;
848 else
849 return -1;
850}
851
852//------------------------------------------------------------------------------
853
860{
861 double min, max, mean;
862
863 if (getEdgeLengths (_id, min, max, mean))
864 return mean;
865 else
866 return -1;
867}
ACG::Vec3d Vector
Standard Type for 3d Vector used for scripting.
Definition: DataTypes.hh:176
@ LOGERR
#define DATA_TRIANGLE_MESH
Definition: TriangleMesh.hh:60
bool dataType(DataType _type) const
Definition: BaseObject.cc:219
double minEdgeLength(int _id)
get the minimal edge length
int genus(int _id)
get the genus of the given object
Vector boundingBoxMin(int _id)
get minumum bounding box point
int vertexCount(int _id)
get total number of vertices for a given object
double faceArea(int _id, int _faceHandle)
get the area of a face
void setDescriptions()
set scripting slot descriptions
double meanEdgeLength(int _id)
get the mean edge length
Vector boundingBoxSize(int _id)
get the size of the bounding box
double aspectRatio(int _id, int _faceHandle)
get the aspect ratio of a face
int edgeCount(int _id)
get total number of edges for a given object
double maxEdgeLength(int _id)
get the maximal edge length
int componentCount(int _id)
get the number of components for a given object
double edgeLength(int _id, int _edgeHandle)
get the length of an edge
void getEdgeLengths(MeshT *_mesh, double &min, double &max, double &mean)
Get edge lengths.
Vector cog(int _id)
get the center of gravity
Vector boundingBoxMax(int _id)
get maximum bounding box point
int faceCount(int _id)
get total number of faces for a given object
int boundaryCount(int _id)
get the number of boundaries for a given object
int vertexValence(int _id, int _vertexHandle)
get vertex valence
bool is_valid() const
The handle is valid iff the index is not negative.
Definition: Handles.hh:72
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition: PolyMeshT.hh:167
Kernel::FaceHandle FaceHandle
Scalar type.
Definition: PolyMeshT.hh:139
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:112
Scalar aspectRatio(const VectorT< Scalar, N > &_v0, const VectorT< Scalar, N > &_v1, const VectorT< Scalar, N > &_v2)
return aspect ratio (length/height) of triangle
Definition: Algorithms.cc:1256
Vec::value_type triangleArea(const Vec &_v0, const Vec &_v1, const Vec &_v2)
return area of triangle (_v0, _v1, _v2)
Definition: Algorithms.hh:595
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
TriMesh * triMesh(BaseObjectData *_object)
Get a triangle mesh from an object.
PolyMesh * polyMesh(BaseObjectData *_object)
Get a poly mesh from an object.
SmartHalfedgeHandle h0() const
Shorthand for halfedge(0)
PolyConnectivity::ConstFaceVertexRange vertices() const
Returns a range of vertices incident to the face (PolyConnectivity::fv_range())
SmartVertexHandle from() const
Returns vertex at start of halfedge.
SmartVertexHandle to() const
Returns vertex pointed to by halfedge.
Smart version of VertexHandle contains a pointer to the corresponding mesh and allows easier access t...
PolyConnectivity::ConstVertexVertexRange vertices() const
Returns a range of vertices adjacent to the vertex (PolyConnectivity::vv_range())