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) 2021 3Dconnexion
5 * Copyright (C) 2021 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
31// stdlib
32#include <map>
33#include <string>
34#include <vector>
35
36#include <wx/mstream.h>
37
45const wxChar* NL_3D_VIEWER_PLUGIN_IMPL::m_logTrace = wxT( "KI_TRACE_NL_3D_VIEWER_PLUGIN" );
46
47
56template <glm::length_t L, glm::length_t C, class T, glm::qualifier Q>
57bool equals( glm::mat<L, C, T, Q> const& aFirst, glm::mat<L, C, T, Q> const& aSecond,
58 T aEpsilon = static_cast<T>( FLT_EPSILON * 10 ) )
59{
60 T const* first = glm::value_ptr( aFirst );
61 T const* second = glm::value_ptr( aSecond );
62
63 for( glm::length_t j = 0; j < L * C; ++j )
64 {
65 if( !equals( first[j], second[j], aEpsilon ) )
66 {
67 return false;
68 }
69 }
70
71 return true;
72}
73
74
76 NAV_3D( false, false ),
77 m_canvas( aCanvas ),
78 m_capIsMoving( false ),
79 m_newWidth( 0.0 )
80{
81 m_camera = dynamic_cast<TRACK_BALL*>( m_canvas->GetCamera() );
82
83 PutProfileHint( "KiCAD 3D" );
84
85 EnableNavigation( true );
86 PutFrameTimingSource( TimingSource::SpaceMouse );
87
89}
90
91
93{
94 EnableNavigation( false );
95}
96
97
99{
100 wxLogTrace( m_logTrace, wxT( "NL_3D_VIEWER_PLUGIN_IMPL::SetFocus %d" ), aFocus );
101 NAV_3D::Write( navlib::focus_k, aFocus );
102}
103
104// temporary store for the categories
105typedef std::map<std::string, TDx::CCommandTreeNode*> CATEGORY_STORE;
106
116CATEGORY_STORE::iterator add_category( std::string aCategoryPath, CATEGORY_STORE& aCategoryStore )
117{
118 using TDx::SpaceMouse::CCategory;
119
120 CATEGORY_STORE::iterator parent_iter = aCategoryStore.begin();
121 std::string::size_type pos = aCategoryPath.find_last_of( '.' );
122
123 if( pos != std::string::npos )
124 {
125 std::string parentPath = aCategoryPath.substr( 0, pos );
126 parent_iter = aCategoryStore.find( parentPath );
127
128 if( parent_iter == aCategoryStore.end() )
129 {
130 parent_iter = add_category( parentPath, aCategoryStore );
131 }
132 }
133
134 std::string name = aCategoryPath.substr( pos + 1 );
135 std::unique_ptr<CCategory> categoryNode =
136 std::make_unique<CCategory>( aCategoryPath.c_str(), name.c_str() );
137
138 CATEGORY_STORE::iterator iter = aCategoryStore.insert(
139 aCategoryStore.end(), CATEGORY_STORE::value_type( aCategoryPath, categoryNode.get() ) );
140
141 parent_iter->second->push_back( std::move( categoryNode ) );
142 return iter;
143}
144
145
147{
148 wxLogTrace( m_logTrace, wxT( "NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages" ) );
149
150 std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
151
152 if( actions.size() == 0 )
153 {
154 return;
155 }
156
157 using TDx::SpaceMouse::CCommand;
158 using TDx::SpaceMouse::CCommandSet;
159
160 // The root action set node
161 CCommandSet commandSet( "EDA_3D_CANVAS", "3D Viewer" );
162
163 // Activate the command set
164 NAV_3D::PutActiveCommands( commandSet.GetId() );
165
166 // temporary store for the categories
167 CATEGORY_STORE categoryStore;
168
169 std::vector<TDx::CImage> vImages;
170
171 // add the action set to the category_store
172 categoryStore.insert( categoryStore.end(), CATEGORY_STORE::value_type( ".", &commandSet ) );
173
174 std::list<TOOL_ACTION*>::const_iterator it;
175
176 for( it = actions.begin(); it != actions.end(); ++it )
177 {
178 const TOOL_ACTION* action = *it;
179 std::string label = action->GetMenuLabel().ToStdString();
180
181 if( label.empty() )
182 {
183 continue;
184 }
185
186 std::string name = action->GetName();
187
188 // Do no export commands for the pcbnew app.
189 if( name.rfind( "pcbnew.", 0 ) == 0 )
190 {
191 continue;
192 }
193
194 std::string strCategory = action->GetToolName();
195 CATEGORY_STORE::iterator iter = categoryStore.find( strCategory );
196
197 if( iter == categoryStore.end() )
198 {
199 iter = add_category( std::move( strCategory ), categoryStore );
200 }
201
202 std::string description = action->GetDescription().ToStdString();
203
204 // Arbitrary 8-bit data stream
205 wxMemoryOutputStream imageStream;
206
207 if( action->GetIcon() != BITMAPS::INVALID_BITMAP )
208 {
209 wxImage image = KiBitmap( action->GetIcon() ).ConvertToImage();
210 image.SaveFile( imageStream, wxBitmapType::wxBITMAP_TYPE_PNG );
211 image.Destroy();
212
213 if( imageStream.GetSize() )
214 {
215 wxStreamBuffer* streamBuffer = imageStream.GetOutputStreamBuffer();
216 TDx::CImage tdxImage = TDx::CImage::FromData( "", 0, name.c_str() );
217 tdxImage.AssignImage( std::string( reinterpret_cast<const char*>(
218 streamBuffer->GetBufferStart() ),
219 streamBuffer->GetBufferSize() ),
220 0 );
221
222 wxLogTrace( m_logTrace, wxT( "Adding image for : %s" ), name );
223 vImages.push_back( std::move( tdxImage ) );
224 }
225 }
226
227 wxLogTrace( m_logTrace, wxT( "Inserting command: %s, description: %s, in category: %s" ),
228 name, description, iter->first );
229
230 iter->second->push_back(
231 CCommand( std::move( name ), std::move( label ), std::move( description ) ) );
232 }
233
234 NAV_3D::AddCommandSet( commandSet );
235 NAV_3D::AddImages( vImages );
236}
237
238
239long NL_3D_VIEWER_PLUGIN_IMPL::GetCameraMatrix( navlib::matrix_t& matrix ) const
240{
241 // cache the camera matrix so that we can tell if the view has been moved and
242 // calculate a delta transform if required.
244
245 std::copy_n( glm::value_ptr( glm::inverse( m_cameraMatrix ) ), 16, matrix.m );
246
247 return 0;
248}
249
250
251long NL_3D_VIEWER_PLUGIN_IMPL::GetPointerPosition( navlib::point_t& position ) const
252{
253 SFVEC3F origin, direction;
254 m_camera->MakeRayAtCurrentMousePosition( origin, direction );
255
256 position = { origin.x, origin.y, origin.z };
257
258 return 0;
259}
260
261
262long NL_3D_VIEWER_PLUGIN_IMPL::GetViewExtents( navlib::box_t& extents ) const
263{
264 if( m_camera->GetProjection() == PROJECTION_TYPE::PERSPECTIVE )
265 {
266 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
267 }
268
269 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
270
271 double half_width = f.fw / 2.;
272 double half_height = f.fh / 2.;
273 extents = { -half_width, -half_height, f.nearD, half_width, half_height, f.farD };
274
275 return 0;
276}
277
278
279long NL_3D_VIEWER_PLUGIN_IMPL::GetViewFOV( double& aFov ) const
280{
281 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
282
283 aFov = glm::radians( f.angle );
284 return 0;
285}
286
287
288long NL_3D_VIEWER_PLUGIN_IMPL::GetViewFrustum( navlib::frustum_t& aFrustum ) const
289{
290 if( m_camera->GetProjection() != PROJECTION_TYPE::PERSPECTIVE )
291 {
292 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
293 }
294
295 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
296 double half_width = f.nw / 2.;
297 double half_height = f.nh / 2.;
298 aFrustum = { -half_width, half_width, -half_height, half_height, f.nearD, f.farD };
299
300 return 0;
301}
302
303
304long NL_3D_VIEWER_PLUGIN_IMPL::GetIsViewPerspective( navlib::bool_t& perspective ) const
305{
306 perspective = m_camera->GetProjection() == PROJECTION_TYPE::PERSPECTIVE ? 1 : 0;
307
308 return 0;
309}
310
311
312long NL_3D_VIEWER_PLUGIN_IMPL::SetCameraMatrix( const navlib::matrix_t& aCameraMatrix )
313{
314 long result = 0;
315
316 glm::mat4 cam, viewMatrix;
317 std::copy_n( aCameraMatrix.m, 16, glm::value_ptr( cam ) );
318 viewMatrix = glm::inverse( cam );
319
320 glm::mat4 camera = m_camera->GetViewMatrix();
321
322 // The navlib does not move the camera in its z-axis in an orthographic projection
323 // as this does not change the viewed object size. However ...
324
325 if( m_camera->GetProjection() == PROJECTION_TYPE::ORTHO )
326 {
327 // ... the CAMERA class couples zoom and distance to the object: we need to
328 // ensure that The CAMERA's z position relative to the lookat_pos is not changed
329 // in an orthographic projection.
330 glm::vec4 lookat( m_camera->GetLookAtPos(), 1.0f );
331 glm::vec4 lookat_new = viewMatrix * lookat;
332 glm::vec4 lookat_old = camera * lookat;
333
334 viewMatrix[3].z += lookat_old.z - lookat_new.z;
335 }
336
337 if( !equals( camera, m_cameraMatrix ) )
338 {
339 // Some other input device has moved the camera. Apply only the intended delta
340 // transform ...
341 m_camera->SetViewMatrix( viewMatrix * glm::inverse( m_cameraMatrix ) * camera );
342 m_camera->Update();
343
344 // .., cache the intended camera matrix so that we can calculate the delta
345 // transform when needed ...
346 m_cameraMatrix = viewMatrix;
347
348 // ... and let the 3DMouse controller know, that something is amiss.
349 return navlib::make_result_code( navlib::navlib_errc::error );
350 }
351
352 m_camera->SetViewMatrix( viewMatrix );
353 m_camera->Update();
354
355 // cache the view matrix so that we know when it has changed.
357
358 // The camera has a constraint on the z position so we need to check that ...
359
360 if( !equals( m_cameraMatrix[3].z, viewMatrix[3].z ) )
361 {
362 // ... and let the 3DMouse controller know, when something is amiss.
363 return navlib::make_result_code( navlib::navlib_errc::error );
364 }
365
366 return 0;
367}
368
369
370long NL_3D_VIEWER_PLUGIN_IMPL::SetViewExtents( const navlib::box_t& extents )
371{
372 const CAMERA_FRUSTUM& f = m_camera->GetFrustum();
373
374 float factor = f.nw / ( extents.max_x - extents.min_x );
375 float zoom = m_camera->GetZoom() / factor;
376
377 m_camera->Zoom( factor );
378
379 // The camera auto positions the camera to match the zoom values. We need to
380 // update our cached camera matrix to match the new z value
382
383 // The camera has a constraint on the zoom factor so we need to check that ...
384 if( zoom != m_camera->GetZoom() )
385 {
386 // ... and let the 3DMouse controller know, when something is amiss.
387 return navlib::make_result_code( navlib::navlib_errc::error );
388 }
389
390 return 0;
391}
392
393
395{
396 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
397}
398
399
400long NL_3D_VIEWER_PLUGIN_IMPL::SetViewFrustum( const navlib::frustum_t& frustum )
401{
402 return navlib::make_result_code( navlib::navlib_errc::permission_denied );
403}
404
405
406long NL_3D_VIEWER_PLUGIN_IMPL::GetModelExtents( navlib::box_t& extents ) const
407{
410
411 extents = { min.x, min.y, min.z, max.x, max.y, max.z };
412
413 return 0;
414}
415
416
417long NL_3D_VIEWER_PLUGIN_IMPL::GetSelectionExtents( navlib::box_t& extents ) const
418{
419 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
420}
421
422
423long NL_3D_VIEWER_PLUGIN_IMPL::GetSelectionTransform( navlib::matrix_t& transform ) const
424{
425 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
426}
427
428
430{
431 empty = true;
432
433 return 0;
434}
435
436
437long NL_3D_VIEWER_PLUGIN_IMPL::SetSelectionTransform( const navlib::matrix_t& matrix )
438{
439 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
440}
441
442
443long NL_3D_VIEWER_PLUGIN_IMPL::GetPivotPosition( navlib::point_t& position ) const
444{
446
447 position = { lap.x, lap.y, lap.z };
448
449 return 0;
450}
451
452
453long NL_3D_VIEWER_PLUGIN_IMPL::IsUserPivot( navlib::bool_t& userPivot ) const
454{
455 userPivot = false;
456
457 return 0;
458}
459
460
461long NL_3D_VIEWER_PLUGIN_IMPL::SetPivotPosition( const navlib::point_t& position )
462{
463 SFVEC3F pivotPos = SFVEC3F( position.x, position.y, position.z );
464
465 // Set the 3dmouse pivot position.
466 m_canvas->Set3dmousePivotPos( pivotPos );
467
468 // Set the camera lookat pos.
469 m_camera->SetLookAtPos_T1( pivotPos );
470
472
473 return 0;
474}
475
476
477long NL_3D_VIEWER_PLUGIN_IMPL::GetPivotVisible( navlib::bool_t& visible ) const
478{
479 visible = m_canvas->GetRender3dmousePivot();
480
481 return 0;
482}
483
484
486{
488
490
491 return 0;
492}
493
494
495long NL_3D_VIEWER_PLUGIN_IMPL::GetHitLookAt( navlib::point_t& position ) const
496{
497 RAY mouseRay;
498 mouseRay.Init( m_rayOrigin, m_rayDirection );
499
500 float hit;
501 glm::vec3 vec;
502
503 // Test it with the board bounding box
504
505 if( m_canvas->GetBoardAdapter().GetBBox().Intersect( mouseRay, &hit ) )
506 {
507 vec = mouseRay.at( hit );
508 position = { vec.x, vec.y, vec.z };
509 return 0;
510 }
511
512 return navlib::make_result_code( navlib::navlib_errc::no_data_available );
513}
514
515
517{
518 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
519}
520
521
522long NL_3D_VIEWER_PLUGIN_IMPL::SetHitDirection( const navlib::vector_t& direction )
523{
524 m_rayDirection = { direction.x, direction.y, direction.z };
525
526 return 0;
527}
528
529
530long NL_3D_VIEWER_PLUGIN_IMPL::SetHitLookFrom( const navlib::point_t& eye )
531{
532 m_rayOrigin = { eye.x, eye.y, eye.z };
533
534 return 0;
535}
536
537
539{
540 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
541}
542
543
545{
546 if( commandId.empty() )
547 {
548 return 0;
549 }
550
551 std::list<TOOL_ACTION*> actions = ACTION_MANAGER::GetActionList();
552 TOOL_ACTION* context = nullptr;
553
554 for( std::list<TOOL_ACTION*>::const_iterator it = actions.begin(); it != actions.end(); it++ )
555 {
556 TOOL_ACTION* action = *it;
557 std::string nm = action->GetName();
558
559 if( commandId == nm )
560 {
561 context = action;
562 }
563 }
564
565 if( context != nullptr )
566 {
567 wxWindow* parent = m_canvas->GetParent();
568
569 // Only allow command execution if the window is enabled. i.e. there is not a modal dialog
570 // currently active.
571
572 if( parent->IsEnabled() )
573 {
574 TOOL_MANAGER* tool_manager = static_cast<PCB_BASE_FRAME*>( parent )->GetToolManager();
575
576 if( tool_manager == nullptr )
577 {
578 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
579 }
580
581 // Get the selection to use to test if the action is enabled
582 SELECTION& sel = tool_manager->GetToolHolder()->GetCurrentSelection();
583
584 bool runAction = true;
585
586 if( const ACTION_CONDITIONS* aCond =
587 tool_manager->GetActionManager()->GetCondition( *context ) )
588 {
589 runAction = aCond->enableCondition( sel );
590 }
591
592 if( runAction )
593 {
594 tool_manager->RunAction( *context );
596 }
597 }
598 else
599 {
600 return navlib::make_result_code( navlib::navlib_errc::invalid_operation );
601 }
602 }
603
604 return 0;
605}
606
607
609{
610 return 0;
611}
612
613
615{
616 m_capIsMoving = value;
617
618 return 0;
619}
620
621
623{
624 if( value != 0L )
625 {
626 }
627 else
628 {
629 m_canvas->Request_refresh( true );
630 wxLogTrace( m_logTrace, wxT( "End of transaction" ) );
631 }
632
633 return 0;
634}
635
636
637long NL_3D_VIEWER_PLUGIN_IMPL::SetCameraTarget( const navlib::point_t& position )
638{
639 return navlib::make_result_code( navlib::navlib_errc::function_not_supported );
640}
641
642
643long NL_3D_VIEWER_PLUGIN_IMPL::GetFrontView( navlib::matrix_t& matrix ) const
644{
645 matrix = { 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 };
646 return 0;
647}
648
649
650long NL_3D_VIEWER_PLUGIN_IMPL::GetCoordinateSystem( navlib::matrix_t& matrix ) const
651{
652 // Use the right-handed coordinate system X-right, Z-up, Y-in (row vectors)
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::GetIsViewRotatable( navlib::bool_t& isRotatable ) const
659{
660 isRotatable = true;
661 return 0;
662}
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:304
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
long SetHitLookFrom(const navlib::point_t &aPosition) override
long SetActiveCommand(std::string aCommandId) override
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
NL_3D_VIEWER_PLUGIN_IMPL(EDA_3D_CANVAS *aCanvas)
Initializes a new instance of the NL_3DVIEWER_PLUGIN.
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
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
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
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
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:57
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:145
TOOLS_HOLDER * GetToolHolder() const
Definition: tool_manager.h:397
ACTION_MANAGER * GetActionManager() const
Definition: tool_manager.h:297
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.
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.
Declaration of the NL_3D_VIEWER_PLUGIN_IMPL class.
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:191
const SFVEC3F & Max() const
Return the maximum vertex pointer.
Definition: bbox_3d.h:198
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