73 if( actions.size() == 0 )
78 using TDx::SpaceMouse::CCommand;
79 using TDx::SpaceMouse::CCommandSet;
82 CCommandSet commandSet(
"EDA_3D_CANVAS",
"3D Viewer" );
85 NAV_3D::PutActiveCommands( commandSet.GetId() );
90 std::vector<TDx::CImage> vImages;
93 categoryStore.insert( categoryStore.end(), CATEGORY_STORE::value_type(
".", &commandSet ) );
95 std::list<TOOL_ACTION*>::const_iterator it;
97 for( it = actions.begin(); it != actions.end(); ++it )
100 std::string label = action->
GetMenuLabel().ToStdString();
110 if(
name.rfind(
"pcbnew.", 0 ) == 0 )
116 if(
name.rfind(
"3DViewer.Control.pivotCenter", 0 ) == 0
117 ||
name.rfind(
"3DViewer.Control.material", 0 ) == 0
118 ||
name.rfind(
"3DViewer.Control.attribute", 0 ) == 0
119 ||
name.rfind(
"3DViewer.Control.show", 0 ) == 0 )
125 CATEGORY_STORE::iterator iter = categoryStore.find( strCategory );
127 if( iter == categoryStore.end() )
129 iter =
add_category( std::move( strCategory ), categoryStore );
135 wxMemoryOutputStream imageStream;
140 image.SaveFile( imageStream, wxBitmapType::wxBITMAP_TYPE_PNG );
143 if( imageStream.GetSize() )
145 wxStreamBuffer* streamBuffer = imageStream.GetOutputStreamBuffer();
146 TDx::CImage tdxImage = TDx::CImage::FromData(
"", 0,
name.c_str() );
147 tdxImage.AssignImage( std::string(
reinterpret_cast<const char*
>( streamBuffer->GetBufferStart() ),
148 streamBuffer->GetBufferSize() ),
152 vImages.push_back( std::move( tdxImage ) );
156 wxLogTrace(
m_logTrace, wxT(
"Inserting command: %s, description: %s, in category: %s" ),
157 name, description, iter->first );
159 iter->second->push_back(
160 CCommand( std::move(
name ), std::move( label ), std::move( description ) ) );
163 NAV_3D::AddCommandSet( commandSet );
164 NAV_3D::AddImages( vImages );
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...