1+ //
2+ // Created by calderans on 4/3/25.
3+ //
4+
5+ #include " Topo/CommandImportBlocks.h"
6+ /* ----------------------------------------------------------------------------*/
7+ #include < TkUtil/Exception.h>
8+ /* ----------------------------------------------------------------------------*/
9+ namespace Mgx3D {
10+ /* ----------------------------------------------------------------------------*/
11+ namespace Topo {
12+
13+ /* ----------------------------------------------------------------------------*/
14+ CommandImportBlocks::
15+ CommandImportBlocks (Internal::Context& c, const std::string& n)
16+ : CommandCreateTopo(c, " Import (Topo) Mdl" ), m_filename(n)
17+ {
18+ m_impl = new ImportBlocksImplementation (c, &getInfoCommand (), m_filename);
19+ }
20+ /* ----------------------------------------------------------------------------*/
21+ CommandImportBlocks::~CommandImportBlocks ()
22+ {
23+ if (m_impl)
24+ delete m_impl;
25+ }
26+ /* ----------------------------------------------------------------------------*/
27+ void CommandImportBlocks::
28+ internalExecute ()
29+ {
30+ m_impl->internalExecute ();
31+
32+
33+ for (auto te : getInfoCommand ().getTopoInfoEntity ()){
34+ if (te.first ->getDim () == 0 ){
35+ getTopoManager ().add ((Vertex*)te.first );
36+ }else if (te.first ->getDim () == 1 ){
37+ getTopoManager ().add ((CoEdge*)te.first );
38+ }else if (te.first ->getDim () == 2 ){
39+ getTopoManager ().add ((CoFace*)te.first );
40+ }else if (te.first ->getDim () == 3 ){
41+ getTopoManager ().add ((Block*)te.first );
42+ }
43+ }
44+
45+ }
46+ /* ----------------------------------------------------------------------------*/
47+ void CommandImportBlocks::getPreviewRepresentation (Utils::DisplayRepresentation& dr)
48+ {
49+ MGX_FORBIDDEN (" getPreviewRepresentation non prévu" );
50+ }
51+ /* ----------------------------------------------------------------------------*/
52+ } // end namespace Topo
53+ /* ----------------------------------------------------------------------------*/
54+ } // end namespace Mgx3D
55+ /* ----------------------------------------------------------------------------*/
0 commit comments