00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "mesh/bvert.H"
00010 #include "mesh/bedge.H"
00011 #include "mesh/bface.H"
00012 #include "mesh/bmesh.H"
00013 #include "mesh/mesh_global.H"
00014
00015 #include "mesh_select_cmd.H"
00016
00017 MESH_SELECT_CMD::MESH_SELECT_CMD(Bvert *v)
00018 {
00019
00020 vlist += v;
00021
00022 }
00023
00024 MESH_SELECT_CMD::MESH_SELECT_CMD(Bedge *e)
00025 {
00026
00027 elist += e;
00028
00029 }
00030
00031 MESH_SELECT_CMD::MESH_SELECT_CMD(Bface *f)
00032 {
00033
00034 flist += f;
00035
00036 }
00037
00038 MESH_SELECT_CMD::MESH_SELECT_CMD(const Bvert_list &vl)
00039 : vlist(vl)
00040 {
00041
00042 }
00043
00044 MESH_SELECT_CMD::MESH_SELECT_CMD(const Bedge_list &el)
00045 : elist(el)
00046 {
00047
00048 }
00049
00050 MESH_SELECT_CMD::MESH_SELECT_CMD(const Bface_list &fl)
00051 : flist(fl)
00052 {
00053
00054 }
00055
00056 MESH_SELECT_CMD::MESH_SELECT_CMD(const Bvert_list &vl, const Bedge_list &el)
00057 : vlist(vl), elist(el)
00058 {
00059
00060 }
00061
00062 MESH_SELECT_CMD::MESH_SELECT_CMD(const Bvert_list &vl, const Bface_list &fl)
00063 : vlist(vl), flist(fl)
00064 {
00065
00066 }
00067
00068 MESH_SELECT_CMD::MESH_SELECT_CMD(const Bedge_list &el, const Bface_list &fl)
00069 : elist(el), flist(fl)
00070 {
00071
00072 }
00073
00074 MESH_SELECT_CMD::MESH_SELECT_CMD(const Bvert_list &vl,
00075 const Bedge_list &el,
00076 const Bface_list &fl)
00077 : vlist(vl), elist(el), flist(fl)
00078 {
00079
00080 }
00081
00082 bool
00083 MESH_SELECT_CMD::doit()
00084 {
00085
00086 if(!vlist.empty())
00087 MeshGlobal::select(vlist);
00088
00089 if(!elist.empty())
00090 MeshGlobal::select(elist);
00091
00092 if(!flist.empty())
00093 MeshGlobal::select(flist);
00094
00095 return COMMAND::doit();
00096
00097 }
00098
00099 bool
00100 MESH_SELECT_CMD::undoit()
00101 {
00102
00103 if(!vlist.empty())
00104 MeshGlobal::deselect(vlist);
00105
00106 if(!elist.empty())
00107 MeshGlobal::deselect(elist);
00108
00109 if(!flist.empty())
00110 MeshGlobal::deselect(flist);
00111
00112 return COMMAND::undoit();
00113
00114 }
00115
00116 MESH_DESELECT_ALL_CMD::MESH_DESELECT_ALL_CMD()
00117 : MESH_DESELECT_CMD(MeshGlobal::selected_verts(),
00118 MeshGlobal::selected_edges(),
00119 MeshGlobal::selected_faces())
00120 {
00121
00122 }