50 #include "MeshObjectSelectionPlugin.hh" 60 if(_faceList.empty() )
return;
64 emit log(
LOGERR,tr(
"selectFaces : unable to get object"));
73 emit log(
LOGERR,tr(
"selectFaces : Unsupported object Type"));
77 QString selection =
"selectFaces(ObjectId(" + QString::number(objectId) +
") , [ " + QString::number(_faceList[0]);
79 for (uint i = 1 ; i < _faceList.size(); ++i) {
80 selection +=
" , " + QString::number(_faceList[i]);
86 emit scriptInfo(selection);
100 if(_faceList.empty() )
return;
104 emit log(
LOGERR,tr(
"unselectFaces : unable to get object"));
113 emit log(
LOGERR,tr(
"unselectFaces : Unsupported object Type"));
117 QString selection =
"unselectFaces(ObjectId(" + QString::number(objectId) +
") , [ " + QString::number(_faceList[0]);
119 for (uint i = 1 ; i < _faceList.size(); ++i) {
120 selection +=
" , " + QString::number(_faceList[i]);
126 emit scriptInfo(selection);
135 emit log(
LOGERR,tr(
"selectAllFaces : unable to get object"));
144 emit log(
LOGERR,tr(
"selectAllFaces : Unsupported object Type"));
149 emit scriptInfo(
"selectAllFaces(ObjectId(" + QString::number(objectId) +
"))");
158 emit log(
LOGERR,tr(
"clearFaceSelection : unable to get object"));
167 emit log(
LOGERR,tr(
"clearFaceSelection : Unsupported object Type"));
172 emit scriptInfo(
"clearFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
181 emit log(
LOGERR,tr(
"invertFaceSelection : unable to get object"));
190 emit log(
LOGERR,tr(
"invertFaceSelection : Unsupported object Type"));
195 emit scriptInfo(
"invertFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
204 emit log(
LOGERR,tr(
"deleteFaceSelection: unable to get object"));
213 emit log(
LOGERR,tr(
"deleteFaceSelection: Unsupported object Type"));
218 emit scriptInfo(
"deleteFaceSelection(ObjectId(" + QString::number(_objectId) +
"))");
233 emit log(
LOGERR,tr(
"selectBoundaryFaces : unable to get object"));
242 emit log(
LOGERR,tr(
"selectBoundaryFaces : Unsupported object Type"));
247 emit scriptInfo(
"selectBoundaryFaces(ObjectId(" + QString::number(objectId) +
"))");
257 emit log(
LOGERR,tr(
"shrinkFaceSelection : unable to get object"));
266 emit log(
LOGERR,tr(
"shrinkFaceSelection : Unsupported object Type"));
271 emit scriptInfo(
"shrinkFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
280 emit log(
LOGERR,tr(
"growFaceSelection : unable to get object"));
289 emit log(
LOGERR,tr(
"growFaceSelection : Unsupported object Type"));
294 emit scriptInfo(
"growFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
303 emit log(
LOGERR,tr(
"getFaceSelection : unable to get object"));
307 emit scriptInfo(
"getFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
314 emit log(
LOGERR,tr(
"getFaceSelection : Unsupported object Type"));
326 emit log(
LOGERR,
"colorizeFaceSelection : unable to get object");
335 emit log(
LOGERR,
"colorizeFaceSelection : Unsupported object Type");
340 emit scriptInfo(
"colorizeFaceSelection(ObjectId(" + QString::number(objectId) +
"), " 341 + QString::number(r) +
", " + QString::number(g) +
", " + QString::number(b) +
")");
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
Handle for a face entity.
#define DATA_TRIANGLE_MESH
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
PolyMesh * polyMesh(BaseObjectData *_object)
Get a poly mesh from an object.
void invertFaceSelection(int objectId)
Invert the current face selection.
void growFaceSelection(int objectId)
Grow the current face selection.
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.
bool deleteSelection(MeshT *_mesh, PrimitiveType _primitiveType)
Delete all selected elements of a mesh.
bool selectFace(int _objectId, int _idx, bool _fly_to_face)
Select face with id _idx and maybe fly to it.
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
bool dataType(DataType _type) const
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Functions for selection on a mesh.
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
void colorizeSelection(MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
Colorize the selection.
void selectFaces(int objectId, IdList _facesList)
Select given faces.
bool selectElement(int _objectId, HandleT _handle, bool _fly_to_element)
set dihedral angle threshold for edge selection
const UpdateType UPDATE_COLOR(UpdateTypeSet(1024))
Colors have changed.
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
int createMeshFromFaceSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
const UpdateType UPDATE_SELECTION_FACES(UpdateTypeSet(256))
Face selection has changed.
void selectAllFaces(int objectId)
Select all faces.
void clearFaceSelection(int objectId)
Unselect all faces.
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.