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);
93 if(_faceList.empty() )
return;
97 emit log(
LOGERR,tr(
"unselectFaces : unable to get object"));
106 emit log(
LOGERR,tr(
"unselectFaces : Unsupported object Type"));
110 QString selection =
"unselectFaces(ObjectId(" + QString::number(objectId) +
") , [ " + QString::number(_faceList[0]);
112 for (uint i = 1 ; i < _faceList.size(); ++i) {
113 selection +=
" , " + QString::number(_faceList[i]);
119 emit scriptInfo(selection);
128 emit log(
LOGERR,tr(
"selectAllFaces : unable to get object"));
137 emit log(
LOGERR,tr(
"selectAllFaces : Unsupported object Type"));
142 emit scriptInfo(
"selectAllFaces(ObjectId(" + QString::number(objectId) +
"))");
151 emit log(
LOGERR,tr(
"clearFaceSelection : unable to get object"));
160 emit log(
LOGERR,tr(
"clearFaceSelection : Unsupported object Type"));
165 emit scriptInfo(
"clearFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
174 emit log(
LOGERR,tr(
"invertFaceSelection : unable to get object"));
183 emit log(
LOGERR,tr(
"invertFaceSelection : Unsupported object Type"));
188 emit scriptInfo(
"invertFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
197 emit log(
LOGERR,tr(
"deleteFaceSelection: unable to get object"));
206 emit log(
LOGERR,tr(
"deleteFaceSelection: Unsupported object Type"));
211 emit scriptInfo(
"deleteFaceSelection(ObjectId(" + QString::number(_objectId) +
"))");
226 emit log(
LOGERR,tr(
"selectBoundaryFaces : unable to get object"));
235 emit log(
LOGERR,tr(
"selectBoundaryFaces : Unsupported object Type"));
240 emit scriptInfo(
"selectBoundaryFaces(ObjectId(" + QString::number(objectId) +
"))");
250 emit log(
LOGERR,tr(
"shrinkFaceSelection : unable to get object"));
259 emit log(
LOGERR,tr(
"shrinkFaceSelection : Unsupported object Type"));
264 emit scriptInfo(
"shrinkFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
273 emit log(
LOGERR,tr(
"growFaceSelection : unable to get object"));
282 emit log(
LOGERR,tr(
"growFaceSelection : Unsupported object Type"));
287 emit scriptInfo(
"growFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
296 emit log(
LOGERR,tr(
"getFaceSelection : unable to get object"));
300 emit scriptInfo(
"getFaceSelection(ObjectId(" + QString::number(objectId) +
"))");
307 emit log(
LOGERR,tr(
"getFaceSelection : Unsupported object Type"));
319 emit log(
LOGERR,
"colorizeFaceSelection : unable to get object");
328 emit log(
LOGERR,
"colorizeFaceSelection : Unsupported object Type");
333 emit scriptInfo(
"colorizeFaceSelection(ObjectId(" + QString::number(objectId) +
"), " 334 + QString::number(r) +
", " + QString::number(g) +
", " + QString::number(b) +
")");
void selectFaces(int objectId, IdList _facesList)
Select given faces.
bool deleteSelection(MeshT *_mesh, PrimitiveType _primitiveType)
Delete all selected elements of a mesh.
void deleteFaceSelection(int _objectId)
Delete face that are currently selected.
bool getObject(int _identifier, BSplineCurveObject *&_object)
PolyMesh * polyMesh(BaseObjectData *_object)
Get a poly mesh from an object.
bool dataType(DataType _type) const
void invertFaceSelection(int objectId)
Invert the current face selection.
const UpdateType UPDATE_SELECTION_FACES(UpdateTypeSet(1)<< 8)
Face selection has changed.
void createMeshFromSelection(MeshT &_mesh, MeshT &_newMesh, PrimitiveType _primitiveType)
Create a new mesh from the selection.
void clearFaceSelection(int objectId)
Unselect all faces.
const UpdateType UPDATE_COLOR(UpdateTypeSet(1)<< 10)
Colors have changed.
SelectionInterface::PrimitiveType faceType_
Handle to selection environment.
Functions for selection on a mesh.
int createMeshFromFaceSelection(int _objectId)
Create a mesh containing the face selection of the given mesh.
void shrinkFaceSelection(int objectId)
Shrink the current face selection.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
void selectAllFaces(int objectId)
Select all faces.
void unselectFaces(int objectId, IdList _facesList)
Unselect given faces.
void colorizeFaceSelection(int objectId, int r, int g, int b, int a)
Colorize the face selection.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void selectBoundaryFaces(int objectId)
Select all boundary faces of the given object.
void growFaceSelection(int objectId)
Grow the current face selection.
#define DATA_TRIANGLE_MESH
void colorizeSelection(MeshT *_mesh, PrimitiveType _primitiveTypes, int _red, int _green, int _blue, int _alpha)
Colorize the selection.
IdList getFaceSelection(int objectId)
Return a list of all selected faces.
TriMesh * triMesh(BaseObjectData *_object)
Get a triangle mesh from an object.