KiCad PCB EDA Suite
Loading...
Searching...
No Matches
nl_3d_viewer_plugin_impl.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2024 3Dconnexion
5 * Copyright (C) 2024 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
22
23// 3d-viewer
26
27// KiCAD includes
28#include <tool/action_manager.h>
29#include <tool/tool_manager.h>
30#include <tool/tools_holder.h>
31
32// stdlib
33#include <map>
34#include <string>
35#include <vector>
36
37#include <wx/mstream.h>
38
46const wxChar* NL_3D_VIEWER_PLUGIN_IMPL::m_logTrace = wxT( "KI_TRACE_NL_3D_VIEWER_PLUGIN" );
47
48
57template <glm::length_t L, glm::length_t C, class T, glm::qualifier Q>
58bool equals( glm::mat<L, C, T, Q> const& aFirst, glm::mat<L, C, T, Q> const& aSecond,
59 T aEpsilon = static_cast<T>( FLT_EPSILON * 10 ) )
60{
61 T const* first = glm::value_ptr( aFirst );
62 T const* second = glm::value_ptr( aSecond );
63
64 for( glm::length_t j = 0; j < L * C; ++j )
65 {
66 if( !equals( first[j], second[j], aEpsilon ) )
67 {
68 return false;
69 }
70 }
71
72 return true;
73}
74
75
76NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas, const std::string& aProfileHint ) :
77 NAV_3D( false, false ),
78 m_canvas( aCanvas ),
79 m_capIsMoving( false ),
80 m_newWidth( 0.0 )
81{
82 m_camera = dynamic_cast<TRACK_BALL*>( m_canvas->GetCamera() );
83
84 PutProfileHint( aProfileHint );
85}
86
87
89{
90 EnableNavigation( false );
91}
92
93
95{
96 wxLogTrace( m_logTrace, wxT( "NL_3D_VIEWER_PLUGIN_IMPL::SetFocus %d" ), aFocus );
97 NAV_3D::Write( navlib::focus_k, aFocus );
98}
99
100
102{
103 return m_canvas;
104}
105
106
108{
109 EnableNavigation(true);
110 PutFrameTimingSource(TimingSource::SpaceMouse);
112}
113
123CATEGORY_STORE::iterator add_category( std::string aCategoryPath, CATEGORY_STORE& aCategoryStore )
124{
125 using TDx::SpaceMouse::CCategory;
126
127 CATEGORY_STORE::iterator parent_iter = aCategoryStore.begin();
128 std::string::size_type pos = aCategoryPath.find_last_of( '.' );
129
130 if( pos != std::string::npos )
131 {
132 std::string parentPath = aCategoryPath.substr( 0, pos );
133 parent_iter = aCategoryStore.find( parentPath );
134
135 if( parent_iter == aCategoryStore.end() )
136 {
137 parent_iter = add_category( parentPath, aCategoryStore );
138 }
139 }
140
141 std::string name = aCategoryPath.substr( pos + 1 );
142 std::unique_ptr<CCategory> categoryNode =
143 std::make_unique<CCategory>( aCategoryPath.c_str(), name.c_str() );
144
145 CATEGORY_STORE::iterator iter = aCategoryStore.insert(
146 aCategoryStore.end(), CATEGORY_STORE::value_type( aCategoryPath, categoryNode.get() ) );
147
148 parent_iter->second->push_back( std::move( categoryNode ) );
149 return iter;
150}
151
152
154{
155 wxLogTrace( m_logTrace, wxT( "NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages" ) );
156
157 std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
158
159 if( actions.size() == 0 )
160 {
161 return;
162 }
163
164 using TDx::SpaceMouse::CCommand;
165 using TDx::SpaceMouse::CCommandSet;
166
167 // The root action set node
168 CCommandSet commandSet( "EDA_3D_CANVAS", "3D Viewer" );
169
170 // Activate the command set
171 NAV_3D::PutActiveCommands( commandSet.GetId() );
172
173 // temporary store for the categories
174 CATEGORY_STORE categoryStore;
175
176 std::vector<TDx::CImage> vImages;
177
178 // add the action set to the category_store
179 categoryStore.insert( categoryStore.end(), CATEGORY_STORE::value_type( ".", &commandSet ) );
180
181 std::list<TOOL_ACTION*>::const_iterator it;
182
183 for( it = actions.begin(); it != actions.end(); ++it )
184 {
185 const TOOL_ACTION* action = *it;
186 std::string label = action->GetMenuLabel().ToStdString();
187
188 if( label.empty() )
189 {
190 continue;
191 }
192
193 std::string name = action->GetName();
194
195 // Do no export commands for the pcbnew app.
196 if( name.rfind( "pcbnew.", 0 ) == 0 )
197 {
198 continue;
199 }
200
201 std::string strCategory = action->GetToolName();
202 CATEGORY_STORE::iterator iter = categoryStore.find( strCategory );
203
204 if( iter == categoryStore.end() )
205 {
206 iter = add_category( std::move( strCategory ), categoryStore );
207 }
208
209 std::string description = action->GetDescription().ToStdString();
210
211 // Arbitrary 8-bit data stream
212 wxMemoryOutputStream imageStream;
213
214 if( action->GetIcon() != BITMAPS::INVALID_BITMAP )
215 {
216 wxImage image = KiBitmap( action->GetIcon() ).ConvertToImage();
217 image.SaveFile( imageStream, wxBitmapType::wxBITMAP_TYPE_PNG );
218 image.Destroy();
219
220 if( imageStream.GetSize() )
221 {
222 wxStreamBuffer* streamBuffer = imageStream.GetOutputStreamBuffer();
223 TDx::CImage tdxImage = TDx::CImage::FromData( "", 0, name.c_str() );
224 tdxImage.AssignImage( std::string( reinterpret_cast<const char*>(
225 streamBuffer->GetBufferStart() ),
226 streamBuffer->GetBufferSize() ),
227 0 );
228
229 wxLogTrace( m_logTrace, wxT( "Adding image for : %s" ), name );
230 vImages.push_back( std::move( tdxImage ) );
231 }
232 }
233
234 wxLogTrace( m_logTrace, wxT( "Inserting command: %s, description: %s, in category: %s" ),
235 name, description, iter->first );
236
237 iter->second->push_back(
238 CCommand( std::move( name ), std::move( label ), std::move( description ) ) );
239 }
240
241 NAV_3D::AddCommandSet( commandSet );
242 NAV_3D::AddImages( vImages );
243}
244
245
246long NL_3D_VIEWER_PLUGIN_IMPL::GetCameraMatrix( navlib::matrix_t& matrix ) const
247{
248 // cache the camera matrix so that we can tell if the view has been moved and
249 // calculate a delta transform if required.
251
252 std::copy_n( glm::value_ptr( glm::inverse( m_cameraMatrix ) ), 16, matrix.m );
253
254 return 0;
255}
256
257
258long NL_3D_VIEWER_PLUGIN_IMPL::GetPointerPosition( navlib::point_t& position ) const
259{
260 SFVEC3F origin, direction;
261 m_camera->MakeRayAtCurrentMousePosition( origin, direction );
262
263 position = { origin.x, origin.y, origin.z };
264
265 return 0;
266}
267
268
269long NL_3D_VIEWER_PLUGIN_IMPL::GetViewExtents( navlib::box_t& extents ) const
270{
271 if( m_camera->GetProjection() == PROJECTION_TYPE::PERSPECTIVE )
272 {
273 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
274 }
275
276 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
277
278 double half_width = f.fw / 2.;
279 double half_height = f.fh / 2.;
280 extents = { -half_width, -half_height, f.nearD, half_width, half_height, f.farD };
281
282 return 0;
283}
284
285
286long NL_3D_VIEWER_PLUGIN_IMPL::GetViewFOV( double& aFov ) const
287{
288 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
289
290 aFov = glm::radians( f.angle );
291 return 0;
292}
293
294
295long NL_3D_VIEWER_PLUGIN_IMPL::GetViewFrustum( navlib::frustum_t& aFrustum ) const
296{
297 if( m_camera->GetProjection() != PROJECTION_TYPE::PERSPECTIVE )
298 {
299 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
300 }
301
302 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
303 double half_width = f.nw / 2.;
304 double half_height = f.nh / 2.;
305 aFrustum = { -half_width, half_width, -half_height, half_height, f.nearD, f.farD };
306
307 return 0;
308}
309
310
311long NL_3D_VIEWER_PLUGIN_IMPL::GetIsViewPerspective( navlib::bool_t& perspective ) const
312{
313 perspective = m_camera->GetProjection() == PROJECTION_TYPE::PERSPECTIVE ? 1 : 0;
314
315 return 0;
316}
317
318
319long NL_3D_VIEWER_PLUGIN_IMPL::SetCameraMatrix( const navlib::matrix_t& aCameraMatrix )
320{
321 long result = 0;
322
323 glm::mat4 cam, viewMatrix;
324 std::copy_n( aCameraMatrix.m, 16, glm::value_ptr( cam ) );
325 viewMatrix = glm::inverse( cam );
326
327 glm::mat4 camera = m_camera->GetViewMatrix();
328
329 // The navlib does not move the camera in its z-axis in an orthographic projection
330 // as this does not change the viewed object size. However ...
331
332 if( m_camera->GetProjection() == PROJECTION_TYPE::ORTHO )
333 {
334 // ... the CAMERA class couples zoom and distance to the object: we need to
335 // ensure that The CAMERA's z position relative to the lookat_pos is not changed
336 // in an orthographic projection.
337 glm::vec4 lookat( m_camera->GetLookAtPos(), 1.0f );
338 glm::vec4 lookat_new = viewMatrix * lookat;
339 glm::vec4 lookat_old = camera * lookat;
340
341 viewMatrix[3].z += lookat_old.z - lookat_new.z;
342 }
343
344 if( !equals( camera, m_cameraMatrix ) )
345 {
346 // Some other input device has moved the camera. Apply only the intended delta
347 // transform ...
348 m_camera->SetViewMatrix( viewMatrix * glm::inverse( m_cameraMatrix ) * camera );
349 m_camera->Update();
350
351 // .., cache the intended camera matrix so that we can calculate the delta
352 // transform when needed ...
353 m_cameraMatrix = viewMatrix;
354
355 // ... and let the 3DMouse controller know, that something is amiss.
356 return navlib::make_result_code( navlib::navlib_errc::error );
357 }
358
359 m_camera->SetViewMatrix( viewMatrix );
360 m_camera->Update();
361
362 // cache the view matrix so that we know when it has changed.
364
365 // The camera has a constraint on the z position so we need to check that ...
366
367 if( !equals( m_cameraMatrix[3].z, viewMatrix[3].z ) )
368 {
369 // ... and let the 3DMouse controller know, when something is amiss.
370 return navlib::make_result_code( navlib::navlib_errc::error );
371 }
372
373 return 0;
374}
375
376
377long NL_3D_VIEWER_PLUGIN_IMPL::SetViewExtents( const navlib::box_t& extents )
378{
379 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
380
381 float factor = f.nw / ( extents.max_x - extents.min_x );
382 float zoom = m_camera->GetZoom() / factor;
383
384 m_camera->Zoom( factor );
385
386 // The camera auto positions the camera to match the zoom values. We need to
387 // update our cached camera matrix to match the new z value
389
390 // The camera has a constraint on the zoom factor so we need to check that ...
391 if( zoom != m_camera->GetZoom() )
392 {
393 // ... and let the 3DMouse controller know, when something is amiss.
394 return navlib::make_result_code( navlib::navlib_errc::error );
395 }
396
397 return 0;
398}
399
400
402{
403 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
404}
405
406
407long NL_3D_VIEWER_PLUGIN_IMPL::SetViewFrustum( const navlib::frustum_t& frustum )
408{
409 return navlib::make_result_code( navlib::navlib_errc::permission_denied );
410}
411
412
413long NL_3D_VIEWER_PLUGIN_IMPL::GetModelExtents( navlib::box_t& extents ) const
414{
417
418 extents = { min.x, min.y, min.z, max.x, max.y, max.z };
419
420 return 0;
421}
422
423
424long NL_3D_VIEWER_PLUGIN_IMPL::GetSelectionExtents( navlib::box_t& extents ) const
425{
426 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
427}
428
429
430long NL_3D_VIEWER_PLUGIN_IMPL::GetSelectionTransform( navlib::matrix_t& transform ) const
431{
432 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
433}
434
435
437{
438 empty = true;
439
440 return 0;
441}
442
443
444long NL_3D_VIEWER_PLUGIN_IMPL::SetSelectionTransform( const navlib::matrix_t& matrix )
445{
446 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
447}
448
449
450long NL_3D_VIEWER_PLUGIN_IMPL::GetPivotPosition( navlib::point_t& position ) const
451{
453
454 position = { lap.x, lap.y, lap.z };
455
456 return 0;
457}
458
459
460long NL_3D_VIEWER_PLUGIN_IMPL::IsUserPivot( navlib::bool_t& userPivot ) const
461{
462 userPivot = false;
463
464 return 0;
465}
466
467
468long NL_3D_VIEWER_PLUGIN_IMPL::SetPivotPosition( const navlib::point_t& position )
469{
470 SFVEC3F pivotPos = SFVEC3F( position.x, position.y, position.z );
471
472 // Set the 3dmouse pivot position.
473 m_canvas->Set3dmousePivotPos( pivotPos );
474
475 // Set the camera lookat pos.
476 m_camera->SetLookAtPos_T1( pivotPos );
477
479
480 return 0;
481}
482
483
484long NL_3D_VIEWER_PLUGIN_IMPL::GetPivotVisible( navlib::bool_t& visible ) const
485{
486 visible = m_canvas->GetRender3dmousePivot();
487
488 return 0;
489}
490
491
493{
495
497
498 return 0;
499}
500
501
502long NL_3D_VIEWER_PLUGIN_IMPL::GetHitLookAt( navlib::point_t& position ) const
503{
504 RAY mouseRay;
505 mouseRay.Init( m_rayOrigin, m_rayDirection );
506
507 float hit;
508 glm::vec3 vec;
509
510 // Test it with the board bounding box
511
512 if( m_canvas->GetBoardAdapter().GetBBox().Intersect( mouseRay, &hit ) )
513 {
514 vec = mouseRay.at( hit );
515 position = { vec.x, vec.y, vec.z };
516 return 0;
517 }
518
519 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
520}
521
522
524{
525 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
526}
527
528
529long NL_3D_VIEWER_PLUGIN_IMPL::SetHitDirection( const navlib::vector_t& direction )
530{
531 m_rayDirection = { direction.x, direction.y, direction.z };
532
533 return 0;
534}
535
536
537long NL_3D_VIEWER_PLUGIN_IMPL::SetHitLookFrom( const navlib::point_t& eye )
538{
539 m_rayOrigin = { eye.x, eye.y, eye.z };
540
541 return 0;
542}
543
544
546{
547 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
548}
549
550
552{
553 if( commandId.empty() )
554 {
555 return 0;
556 }
557
558 std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
559 TOOL_ACTION* context = nullptr;
560
561 for( std::list<TOOL_ACTION*>::const_iterator it = actions.begin(); it != actions.end(); it++ )
562 {
563 TOOL_ACTION* action = *it;
564 std::string nm = action->GetName();
565
566 if( commandId == nm )
567 {
568 context = action;
569 }
570 }
571
572 if( context != nullptr )
573 {
574 wxWindow* parent = m_canvas->GetParent();
575
576 // Only allow command execution if the window is enabled. i.e. there is not a modal dialog
577 // currently active.
578 TOOLS_HOLDER* tools_holder = nullptr;
579
580 if( parent->IsEnabled() && ( tools_holder = dynamic_cast<TOOLS_HOLDER*>( parent ) ) )
581 {
582 TOOL_MANAGER* tool_manager = tools_holder->GetToolManager();
583
584 if( tool_manager == nullptr )
585 {
586 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
587 }
588
589 // Get the selection to use to test if the action is enabled
590 SELECTION& sel = tool_manager->GetToolHolder()->GetCurrentSelection();
591
592 bool runAction = true;
593
594 if( const ACTION_CONDITIONS* aCond =
595 tool_manager->GetActionManager()->GetCondition( *context ) )
596 {
597 runAction = aCond->enableCondition( sel );
598 }
599
600 if( runAction )
601 {
602 tool_manager->RunAction( *context );
604 }
605 }
606 else
607 {
608 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
609 }
610 }
611
612 return 0;
613}
614
615
617{
618 return 0;
619}
620
621
623{
624 m_capIsMoving = value;
625
626 return 0;
627}
628
629
631{
632 if( value != 0L )
633 {
634 }
635 else
636 {
637 m_canvas->Request_refresh( true );
638 wxLogTrace( m_logTrace, wxT( "End of transaction" ) );
639 }
640
641 return 0;
642}
643
644
645long NL_3D_VIEWER_PLUGIN_IMPL::SetCameraTarget( const navlib::point_t& position )
646{
647 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
648}
649
650
651long NL_3D_VIEWER_PLUGIN_IMPL::GetFrontView( navlib::matrix_t& matrix ) const
652{
653 matrix = { 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 };
654 return 0;
655}
656
657
658long NL_3D_VIEWER_PLUGIN_IMPL::GetCoordinateSystem( navlib::matrix_t& matrix ) const
659{
660 // Use the right-handed coordinate system X-right, Z-up, Y-in (row vectors)
661 matrix = { 1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1 };
662 return 0;
663}
664
665
666long NL_3D_VIEWER_PLUGIN_IMPL::GetIsViewRotatable( navlib::bool_t& isRotatable ) const
667{
668 isRotatable = true;
669 return 0;
670}
const char * name
Definition: DXF_plotter.cpp:57
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
const ACTION_CONDITIONS * GetCondition(const TOOL_ACTION &aAction) const
Get the conditions to use for a specific tool action.
static std::list< TOOL_ACTION * > & GetActionList()
Return list of TOOL_ACTIONs.
const BBOX_3D & GetBBox() const noexcept
Get the board outling bounding box.
const CAMERA_FRUSTUM & GetFrustum() const
Definition: camera.h:140
bool Zoom(float aFactor)
Definition: camera.cpp:597
PROJECTION_TYPE GetProjection()
Definition: camera.h:205
float GetZoom() const
Definition: camera.h:221
const SFVEC3F & GetLookAtPos() const
Definition: camera.h:141
void MakeRayAtCurrentMousePosition(SFVEC3F &aOutOrigin, SFVEC3F &aOutDirection) const
Make a ray based on the latest mouse position.
Definition: camera.cpp:461
const glm::mat4 & GetViewMatrix() const
Definition: camera.cpp:509
void SetLookAtPos_T1(const SFVEC3F &aLookAtPos)
Definition: camera.h:162
void SetViewMatrix(glm::mat4 aViewMatrix)
Set the affine matrix to be applied to a transformation camera.
Definition: camera.cpp:515
void Update()
Update the camera.
Definition: camera.h:309
Implement a canvas based on a wxGLCanvas.
Definition: eda_3d_canvas.h:49
void Set3dmousePivotPos(const SFVEC3F &aPos)
Set the position of the the 3dmouse pivot.
bool GetRender3dmousePivot()
Get a value indicating whether to render the 3dmouse pivot.
void SetRender3dmousePivot(bool aValue)
Set aValue indicating whether to render the 3dmouse pivot.
void Request_refresh(bool aRedrawImmediately=true)
Schedule a refresh update of the canvas.
const BOARD_ADAPTER & GetBoardAdapter() const
Get information used to display 3D board.
CAMERA * GetCamera()
Get the canvas camera.
long GetViewExtents(navlib::box_t &aExtents) const override
long GetCameraMatrix(navlib::matrix_t &aMatrix) const override
void Connect()
Connect plugin implementation to the driver.
long SetHitLookFrom(const navlib::point_t &aPosition) override
long SetActiveCommand(std::string aCommandId) override
EDA_3D_CANVAS * GetCanvas() const
Get the m_canvas pointer.
long GetPivotPosition(navlib::point_t &aPosition) const override
long GetModelExtents(navlib::box_t &aExtents) const override
long GetPointerPosition(navlib::point_t &aPosition) const override
long SetPivotVisible(bool aVisible) override
long SetTransaction(long aValue) override
long SetViewFOV(double aFov) override
long SetMotionFlag(bool aValue) override
long SetCameraMatrix(const navlib::matrix_t &aMatrix) override
long GetHitLookAt(navlib::point_t &aPosition) const override
long SetHitAperture(double aAperture) override
long SetPivotPosition(const navlib::point_t &aPosition) override
long SetHitDirection(const navlib::vector_t &aDirection) override
long GetSelectionTransform(navlib::matrix_t &aTransform) const override
long SetSelectionTransform(const navlib::matrix_t &aMatrix) override
long SetSettingsChanged(long aChangeNumber) override
long SetHitSelectionOnly(bool aSelectionOnly) override
long GetIsSelectionEmpty(navlib::bool_t &aEmpty) const override
long GetSelectionExtents(navlib::box_t &aExtents) const override
long GetCoordinateSystem(navlib::matrix_t &aMatrix) const override
long IsUserPivot(navlib::bool_t &aUserPivot) const override
long GetViewFOV(double &aFov) const override
long GetPivotVisible(navlib::bool_t &aVisible) const override
long GetFrontView(navlib::matrix_t &aMatrix) const override
NL_3D_VIEWER_PLUGIN_IMPL(EDA_3D_CANVAS *aCanvas, const std::string &aProfileHint)
Initializes a new instance of the NL_3DVIEWER_PLUGIN.
long GetViewFrustum(navlib::frustum_t &aFrustum) const override
long GetIsViewPerspective(navlib::bool_t &aPerspective) const override
long SetViewFrustum(const navlib::frustum_t &aFrustum) override
long SetViewExtents(const navlib::box_t &aExtents) override
virtual void exportCommandsAndImages()
Export the invocable actions and images to the 3Dconnexion UI.
void SetFocus(bool aFocus=true)
Set the connection to the 3Dconnexion driver to the focus state so that 3DMouse data is routed here.
long GetIsViewRotatable(navlib::bool_t &isRotatable) const override
long SetCameraTarget(const navlib::point_t &aPosition) override
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
virtual SELECTION & GetCurrentSelection()
Get the current selection from the canvas area.
Definition: tools_holder.h:98
Represent a single user action.
Definition: tool_action.h:269
wxString GetMenuLabel() const
Return the translated label for the action.
BITMAPS GetIcon() const
Return an icon associated with the action.
Definition: tool_action.h:422
std::string GetToolName() const
Return name of the tool associated with the action.
const std::string & GetName() const
Return name of the action.
Definition: tool_action.h:302
wxString GetDescription() const
Master controller class:
Definition: tool_manager.h:62
bool RunAction(const std::string &aActionName, T aParam)
Run the specified action immediately, pausing the current action to run the new one.
Definition: tool_manager.h:150
TOOLS_HOLDER * GetToolHolder() const
Definition: tool_manager.h:402
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:302
static bool empty(const wxTextEntryBase *aCtrl)
static const wxChar * m_logTrace
Trace mask used to enable or disable the trace output of this class.
bool equals(glm::mat< L, C, T, Q > const &aFirst, glm::mat< L, C, T, Q > const &aSecond, T aEpsilon=static_cast< T >(FLT_EPSILON *10))
Template to compare two glm::mat<T> values for equality within a required epsilon.
CATEGORY_STORE::iterator add_category(std::string aCategoryPath, CATEGORY_STORE &aCategoryStore)
Add a category to the store.
Declaration of the NL_3D_VIEWER_PLUGIN_IMPL class.
std::map< std::string, TDx::CCommandTreeNode * > CATEGORY_STORE
CATEGORY_STORE::iterator add_category(std::string aCategoryPath, CATEGORY_STORE &aCategoryStore)
Add a category to the store.
TDx::SpaceMouse::Navigation3D::CNavigation3D NAV_3D
Functors that can be used to figure out how the action controls should be displayed in the UI and if ...
bool Intersect(const RAY &aRay, float *t) const
Definition: bbox_3d_ray.cpp:46
const SFVEC3F & Min() const
Return the minimum vertex pointer.
Definition: bbox_3d.h:192
const SFVEC3F & Max() const
Return the maximum vertex pointer.
Definition: bbox_3d.h:199
Frustum is a implementation based on a tutorial by http://www.lighthouse3d.com/tutorials/view-frustum...
Definition: camera.h:50
float angle
Definition: camera.h:61
float fh
Definition: camera.h:62
float nh
Definition: camera.h:62
float fw
Definition: camera.h:62
float farD
Definition: camera.h:61
float nw
Definition: camera.h:62
float nearD
Definition: camera.h:61
Definition: ray.h:63
void Init(const SFVEC3F &o, const SFVEC3F &d)
Definition: ray.cpp:35
SFVEC3F at(float t) const
Definition: ray.h:84
Declaration for a track ball camera.
glm::vec3 SFVEC3F
Definition: xv3d_types.h:44