//========================================================================
// E3D library
//
// Selection
//
// AUTHOR:  Gabor Nagy
// DATE:    2024-Jul-31 20:29:10
//
// Copyright (C) 1996-2026 by Gabor Nagy. All rights reserved.
//========================================================================
#ifndef _E3D_Select_h
#define _E3D_Select_h


#ifndef _E3D_Mesh_h
#include <E3D/Mesh.h>
#endif

#ifndef _E3D_Face_h
#include <E3D/Face.h>
#endif

#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
extern "C" {
#endif


//----------------------------------------
// Select.c
//----------------------------------------
extern void          E3dSelectionList_Free(E3dObjectSelection** PSelectionsP, EIndex* const PNumOfSelectionsP);

extern EBool         E3dSel_ObjectSelect(E3dScene* PScene, E3dObject* PObject, const EBool PUnselectTheRest, const EBool PNotify);
extern E3dPolygon*   E3dSel_TogglePolygonSelection(E3dModel* PModel, E3dGeometry* PGeometry, E3dPolyGroup* PPolyGroup, E3dPolygon* PPolygon, const EBool PUnselectTheRest);
extern void          E3dSel_MeshPolyGroupSelect(E3dScene* PScene, E3dMesh* PMesh, E3dPolyGroup* PPolyGroup,  const uint8_t PSelectionMode, const EBool PUnselectTheRest, const EBool PNotify);
extern EChangeFlags  E3dSel_MeshSelectEdgeLoop(E3dMesh* PMesh, const EIndex PEdgeIndex);

extern E3dNode*      E3dSel_NodeSelect(E3dScene* PScene, E3dNode* const PNode, const EBool PUnselectTheRest, const EBool PNotify);
extern E3dNode*      E3dSel_NodeSelectBranch(E3dScene* PScene, E3dNode* const PBranchRootNode, const EBool PUnselectTheRest, const EBool PNotify);
extern E3dNode*      E3dSel_NodeSelectTree(E3dScene* PScene, E3dNode* const PNode, const EBool PUnselectTheRest, const EBool PNotify);
extern int           E3dSel_NodeUnselectTree(E3dScene* PScene, E3dNode* PNode, const EBool PNotify);

extern E3dNode*      E3dSel_NodeToggleSelection(E3dScene* PScene, E3dNode* PNode, const EBool PUnselectTheRest, const EBool PNotify);
extern E3dNode*      E3dSel_NodeBranchToggleSelection(E3dScene* PScene, E3dNode* PNode, const EBool PUnselectTheRest, const EBool PNotify);
extern E3dNode*      E3dSel_NodeTreeToggleSelection(E3dScene* PScene, E3dNode* PNode, const EBool PUnselectTheRest, const EBool PNotify);

extern EBool         E3dSel_SplineSegmentSetSelection(E3dScene* PScene, E3dSpline* PSpline, const EIndex PSegment, const EBool PSelect, const EBool PUnselectTheRest, const EBool PNotify);
extern void          E3dSel_FaceContourSetSelection(E3dScene* PScene, E3dFace* PFace, int PContourIndex, E3dSpline* PSpline, const EBool PSelect, const EBool PUnselectTheRest, const EBool PNotify);

extern EBool         E3dSel_ObjectToggleSelection(E3dScene* PScene, E3dObject* PObject, const EBool PUnselectTheRest, const EBool PNotify);
extern void          E3dSel_ObjectModelsSetSelection(E3dObject* PObject, const int PSelection);

extern void          E3dSel_SceneUnselectAll(E3dScene* PScene);

extern EBool         E3dSel_InstanceSelect(E3dScene* PScene,  E3dModel* PModel, E3dObject* PObject,  const EBool PUnselectTheRest, const EBool PNotify);


#if defined (__cplusplus) && (!(defined (__CPLUSLIBS)))
}	// Close scope of 'extern "C"' declaration
#endif

#endif	// _E3D_Select_h
