BaseViewer
The BaseViewer class is an abstract base class that defines the interface for GUI viewers in the Sofa framework.
- abstract
- `BaseViewer` is an abstract base class defining the interface for GUI viewers in SOFA, providing methods for scene management, camera control, and rendering.
- sheet
- # BaseViewer **Overview** `BaseViewer` serves as an abstract base class that defines the interface for GUI viewers within the SOFA framework. It provides a set of methods to manage scenes, handle camera settings, and perform rendering operations. **Parameters and Data** The `BaseViewer` class does not expose any significant data fields or parameters directly; its functionality is primarily defined through method implementations in derived classes. **Dependencies and Connections** `BaseViewer` typically requires interaction with other SOFA components such as scene nodes (`sofa::simulation::Node`) for loading scenes, visual parameters (`sofa::core::visual::VisualParams`), and interactor mechanisms. It fits into the scene graph by providing a uniform interface for visualization. **Practical Notes** The `BaseViewer` class is intended to be inherited from in concrete viewer implementations (e.g., OpenGL viewers). Developers must implement pure virtual methods such as `drawScene`, `viewAll`, and `redraw`. Care should be taken when configuring camera modes and handling scene loading/unloading operations for consistency across different viewer types.
- name
- BaseViewer
- description
- The BaseViewer class is an abstract base class that defines the interface for GUI viewers in the Sofa framework.
- parameters
-
- returns
-
- events
-
- methods
-
- {'name': 'drawColourPicking', 'description': 'Draws colour picking with a given code.'}
- {'name': 'getScene', 'description': 'Returns the scene (Node) currently being displayed by the viewer.', 'returns': ['sofa::simulation::Node*']}
- {'name': 'getSceneFileName', 'description': 'Gets the filename of the current scene.', 'returns': ['const std::string&']}
- {'name': 'setSceneFileName', 'description': 'Sets the filename for the current scene.'}
- {'name': 'setScene', 'description': 'Sets the simulation Node to be displayed by the viewer, along with an optional file name and a flag indicating whether parameters should be kept.', 'returns': []}
- {'name': 'setCameraMode', 'description': 'Sets the camera mode for rendering.'}
- {'name': 'ready', 'description': 'Checks if the viewer is ready to render.', 'returns': ['bool']}
- {'name': 'wait', 'description': "Waits until the viewer's activity resumes.", 'returns': []}
- {'name': 'load', 'description': 'Initializes and loads the viewer.', 'returns': ['bool']}
- {'name': 'unload', 'description': 'Unloads the viewer without deleting it.', 'returns': ['bool']}
- {'name': 'viewAll', 'description': 'Computes and applies a view that encompasses the whole scene.'}
- {'name': 'configure', 'description': 'Configures the viewer using Sofa components.'}
- {'name': 'screenshotName', 'description': 'Gets the name for a screenshot.', 'returns': ['const std::string']}
- {'name': 'setPrefix', 'description': 'Sets the prefix and directory path for screenshots.'}
- {'name': 'screenshot', 'description': 'Takes a screenshot with an optional compression level.'}
- {'name': 'getView', 'description': 'Gets the current camera position and orientation.', 'returns': []}
- {'name': 'setView', 'description': 'Sets the camera position and orientation for the viewer.'}
- {'name': 'moveView', 'description': 'Moves the camera view by a given amount of position and rotation.'}
- {'name': 'newView', 'description': 'Resets the view to default settings.'}
- {'name': 'resetView', 'description': "Resets the viewer's view to its initial state."}
- {'name': 'setBackgroundColour', 'description': 'Sets the background color for the viewer.'}
- {'name': 'setBackgroundImage', 'description': 'Sets a background image for the viewer, defaulting to SOFA_logo.bmp if no filename is provided.', 'returns': []}
- {'name': 'getBackgroundImage', 'description': 'Gets the current background image file name.', 'returns': ['std::string']}
- {'name': 'saveView', 'description': 'Saves the current view.'}
- {'name': 'setSizeW', 'description': 'Sets the width of the viewer window.'}
- {'name': 'setSizeH', 'description': 'Sets the height of the viewer window.'}
- {'name': 'getWidth', 'description': 'Gets the width of the viewer window.', 'returns': ['int']}
- {'name': 'getHeight', 'description': 'Gets the height of the viewer window.', 'returns': ['int']}
- {'name': 'captureEvent', 'description': 'Captures an event.'}
- {'name': 'fitObjectBBox', 'description': "Adjusts the view to fit around a given object's bounding box."}
- {'name': 'fitNodeBBox', 'description': "Adjusts the view to fit around a given node's bounding box."}
- {'name': 'setFullScreen', 'description': 'Enables or disables full-screen mode for the viewer.'}
- {'name': 'moveRayPickInteractor', 'description': 'Moves the ray pick interactor by adjusting its position.', 'returns': []}
- {'name': 'getPickHandler', 'description': 'Gets the RayCasting PickHandler used in the viewer.', 'returns': ['PickHandler*']}
- {'name': 'drawScene', 'description': 'Draws and renders the current scene.'}
- {'name': 'setCurrentSelection', 'description': 'Sets the current selection of objects or nodes for the viewer to highlight.', 'returns': []}
- {'name': 'getCurrentSelection', 'description': 'Gets the currently selected objects or nodes in the viewer.', 'returns': ['const std::set<sofa::core::objectmodel::Base::SPtr>&']}
- attributes
-
- {'name': 'm_enableSelectionDraw', 'type': 'bool'}
- {'name': 'm_showSelectedNodeBoundingBox', 'type': 'bool'}
- {'name': 'm_showSelectedObjectBoundingBox', 'type': 'bool'}
- {'name': 'm_showSelectedObjectPositions', 'type': 'bool'}
- {'name': 'm_showSelectedObjectSurfaces', 'type': 'bool'}
- {'name': 'm_showSelectedObjectVolumes', 'type': 'bool'}
- {'name': 'm_showSelectedObjectIndices', 'type': 'bool'}
- {'name': 'm_selectionColor', 'type': 'sofa::type::RGBAColor'}
- {'name': 'm_visualScaling', 'type': 'float'}
- maths
- The `BaseViewer` class serves as an abstract interface for GUI viewers in the Sofa simulation framework. The primary purpose is to establish a set of methods that any concrete implementation of a viewer must adhere to, allowing the user or another part of the program to interact with the visualization aspect of simulations uniformly across different types of visualizations (e.g., OpenGL, WebGL, etc.). ### Mathematical and Physical Description: #### 1. Camera Movement and Positioning: - **View Transformations**: The methods `getView` and `setView` are used to retrieve and set the camera's position and orientation in the scene. This involves translation (position) and rotation (orientation). Mathematically, these transformations can be represented using quaternions (`sofa::type::Quat<SReal>`) for rotations and vectors (`sofa::type::Vec3`) for translations. - **Movement**: The `moveView` method allows for incremental changes to the camera's position. This could involve translating by a given vector or rotating around an axis by a specified angle. #### 2. Scene Rendering: - **Rendering Loop**: The `drawScene` method defines the primary rendering loop where the scene is visualized based on the current state of the simulation, including object positions and appearances. This involves transformations (model-view-projection), lighting calculations, texturing, and possibly post-processing effects. #### 3. Interaction: - **Ray Casting**: The `moveRayPickInteractor` method is a placeholder for ray-casting functionality used in interactivity (e.g., picking objects within the scene). Ray casting involves projecting a line (ray) from the camera's position through the screen to intersect with scene elements. #### 4. Scene Management: - **Scene Handling**: Methods like `getScene`, `setSceneFileName`, and `setScene` handle the loading and unloading of simulation scenes, which are represented by nodes in Sofa’s simulation tree (`sofa::simulation::Node`). This involves file I/O operations and scene graph management. #### 5. Selection Mechanism: - **Selection Management**: The `setCurrentSelection` and `getCurrentSelection` methods manage a set of selected objects within the scene, allowing for interaction with specific parts of the simulation in a detailed manner. The `drawSelection` method visualizes these selections by drawing additional graphics like text or outlines around selected objects. #### 6. Scene Camera Settings: - **Camera Mode**: The `setCameraMode` function configures the camera behavior, which could impact how transformations and view settings are applied during rendering. ### Physical Description: This class does not directly deal with physical simulations but serves as a critical interface for visualizing them. It ensures that any viewer implementing this base class can provide consistent functionality such as navigation through the scene (view manipulation), interaction (object selection, picking), and control over aspects like background color or image settings. The methods provided facilitate operations necessary for creating an interactive, user-friendly environment for simulating physical phenomena, ensuring developers have a standard way to visualize their simulations.
{
"name": "BaseViewer",
"main": {
"name": "BaseViewer",
"namespace": "sofa::gui::common",
"module": "Sofa.GUI.Common",
"include": "sofa/gui/common/BaseViewer.h",
"doc": "",
"inherits": [],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "drawColourPicking",
"return_type": "void",
"params": [
{
"name": "",
"type": "ColourPickingVisitor::ColourCode"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getScene",
"return_type": "sofa::simulation::Node *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getSceneFileName",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setSceneFileName",
"return_type": "void",
"params": [
{
"name": "f",
"type": "const int &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setScene",
"return_type": "void",
"params": [
{
"name": "scene",
"type": "int"
},
{
"name": "filename",
"type": "const char *"
},
{
"name": "",
"type": "bool"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setCameraMode",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::VisualParams::CameraType"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "ready",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "wait",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "load",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "unload",
"return_type": "bool",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "viewAll",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "configure",
"return_type": "void",
"params": [
{
"name": "viewerConf",
"type": "sofa::component::setting::ViewerSetting *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "screenshotName",
"return_type": "const int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setPrefix",
"return_type": "void",
"params": [
{
"name": "prefix",
"type": "const int &"
},
{
"name": "prependDirectory",
"type": "bool"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "screenshot",
"return_type": "void",
"params": [
{
"name": "filename",
"type": "const int &"
},
{
"name": "compression_level",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getView",
"return_type": "void",
"params": [
{
"name": "pos",
"type": "sofa::type::Vec3 &"
},
{
"name": "ori",
"type": "sofa::type::Quat<SReal> &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setView",
"return_type": "void",
"params": [
{
"name": "pos",
"type": "const sofa::type::Vec3 &"
},
{
"name": "ori",
"type": "const sofa::type::Quat<SReal> &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "moveView",
"return_type": "void",
"params": [
{
"name": "pos",
"type": "const sofa::type::Vec3 &"
},
{
"name": "ori",
"type": "const sofa::type::Quat<SReal> &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "newView",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "resetView",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setBackgroundColour",
"return_type": "void",
"params": [
{
"name": "r",
"type": "float"
},
{
"name": "g",
"type": "float"
},
{
"name": "b",
"type": "float"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setBackgroundImage",
"return_type": "void",
"params": [
{
"name": "imageFileName",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getBackgroundImage",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "saveView",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "setSizeW",
"return_type": "void",
"params": [
{
"name": "",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "setSizeH",
"return_type": "void",
"params": [
{
"name": "",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "getWidth",
"return_type": "int",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "getHeight",
"return_type": "int",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "captureEvent",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "fitObjectBBox",
"return_type": "void",
"params": [
{
"name": "",
"type": "sofa::core::objectmodel::BaseObject *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "fitNodeBBox",
"return_type": "void",
"params": [
{
"name": "",
"type": "sofa::core::objectmodel::BaseNode *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setFullScreen",
"return_type": "void",
"params": [
{
"name": "",
"type": "bool"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "moveRayPickInteractor",
"return_type": "void",
"params": [
{
"name": "",
"type": "int"
},
{
"name": "",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPickHandler",
"return_type": "PickHandler *",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "drawScene",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "drawSelection",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "sofa::core::visual::VisualParams *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setCurrentSelection",
"return_type": "void",
"params": [
{
"name": "selection",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getCurrentSelection",
"return_type": "const int &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "drawIndices",
"return_type": "void",
"params": [
{
"name": "bbox",
"type": "const sofa::type::BoundingBox &"
},
{
"name": "positions",
"type": "const int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "redraw",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "protected"
}
]
},
"desc": {
"name": "BaseViewer",
"description": "The BaseViewer class is an abstract base class that defines the interface for GUI viewers in the Sofa framework.",
"parameters": [],
"returns": [],
"events": [],
"methods": [
{
"name": "drawColourPicking",
"description": "Draws colour picking with a given code."
},
{
"name": "getScene",
"description": "Returns the scene (Node) currently being displayed by the viewer.",
"returns": [
"sofa::simulation::Node*"
]
},
{
"name": "getSceneFileName",
"description": "Gets the filename of the current scene.",
"returns": [
"const std::string&"
]
},
{
"name": "setSceneFileName",
"description": "Sets the filename for the current scene."
},
{
"name": "setScene",
"description": "Sets the simulation Node to be displayed by the viewer, along with an optional file name and a flag indicating whether parameters should be kept.",
"returns": []
},
{
"name": "setCameraMode",
"description": "Sets the camera mode for rendering."
},
{
"name": "ready",
"description": "Checks if the viewer is ready to render.",
"returns": [
"bool"
]
},
{
"name": "wait",
"description": "Waits until the viewer's activity resumes.",
"returns": []
},
{
"name": "load",
"description": "Initializes and loads the viewer.",
"returns": [
"bool"
]
},
{
"name": "unload",
"description": "Unloads the viewer without deleting it.",
"returns": [
"bool"
]
},
{
"name": "viewAll",
"description": "Computes and applies a view that encompasses the whole scene."
},
{
"name": "configure",
"description": "Configures the viewer using Sofa components."
},
{
"name": "screenshotName",
"description": "Gets the name for a screenshot.",
"returns": [
"const std::string"
]
},
{
"name": "setPrefix",
"description": "Sets the prefix and directory path for screenshots."
},
{
"name": "screenshot",
"description": "Takes a screenshot with an optional compression level."
},
{
"name": "getView",
"description": "Gets the current camera position and orientation.",
"returns": []
},
{
"name": "setView",
"description": "Sets the camera position and orientation for the viewer."
},
{
"name": "moveView",
"description": "Moves the camera view by a given amount of position and rotation."
},
{
"name": "newView",
"description": "Resets the view to default settings."
},
{
"name": "resetView",
"description": "Resets the viewer's view to its initial state."
},
{
"name": "setBackgroundColour",
"description": "Sets the background color for the viewer."
},
{
"name": "setBackgroundImage",
"description": "Sets a background image for the viewer, defaulting to SOFA_logo.bmp if no filename is provided.",
"returns": []
},
{
"name": "getBackgroundImage",
"description": "Gets the current background image file name.",
"returns": [
"std::string"
]
},
{
"name": "saveView",
"description": "Saves the current view."
},
{
"name": "setSizeW",
"description": "Sets the width of the viewer window."
},
{
"name": "setSizeH",
"description": "Sets the height of the viewer window."
},
{
"name": "getWidth",
"description": "Gets the width of the viewer window.",
"returns": [
"int"
]
},
{
"name": "getHeight",
"description": "Gets the height of the viewer window.",
"returns": [
"int"
]
},
{
"name": "captureEvent",
"description": "Captures an event."
},
{
"name": "fitObjectBBox",
"description": "Adjusts the view to fit around a given object's bounding box."
},
{
"name": "fitNodeBBox",
"description": "Adjusts the view to fit around a given node's bounding box."
},
{
"name": "setFullScreen",
"description": "Enables or disables full-screen mode for the viewer."
},
{
"name": "moveRayPickInteractor",
"description": "Moves the ray pick interactor by adjusting its position.",
"returns": []
},
{
"name": "getPickHandler",
"description": "Gets the RayCasting PickHandler used in the viewer.",
"returns": [
"PickHandler*"
]
},
{
"name": "drawScene",
"description": "Draws and renders the current scene."
},
{
"name": "setCurrentSelection",
"description": "Sets the current selection of objects or nodes for the viewer to highlight.",
"returns": []
},
{
"name": "getCurrentSelection",
"description": "Gets the currently selected objects or nodes in the viewer.",
"returns": [
"const std::set<sofa::core::objectmodel::Base::SPtr>&"
]
}
],
"attributes": [
{
"name": "m_enableSelectionDraw",
"type": "bool"
},
{
"name": "m_showSelectedNodeBoundingBox",
"type": "bool"
},
{
"name": "m_showSelectedObjectBoundingBox",
"type": "bool"
},
{
"name": "m_showSelectedObjectPositions",
"type": "bool"
},
{
"name": "m_showSelectedObjectSurfaces",
"type": "bool"
},
{
"name": "m_showSelectedObjectVolumes",
"type": "bool"
},
{
"name": "m_showSelectedObjectIndices",
"type": "bool"
},
{
"name": "m_selectionColor",
"type": "sofa::type::RGBAColor"
},
{
"name": "m_visualScaling",
"type": "float"
}
]
},
"maths": {
"maths": "The `BaseViewer` class serves as an abstract interface for GUI viewers in the Sofa simulation framework. The primary purpose is to establish a set of methods that any concrete implementation of a viewer must adhere to, allowing the user or another part of the program to interact with the visualization aspect of simulations uniformly across different types of visualizations (e.g., OpenGL, WebGL, etc.).\n\n### Mathematical and Physical Description:\n\n#### 1. Camera Movement and Positioning:\n- **View Transformations**: The methods `getView` and `setView` are used to retrieve and set the camera's position and orientation in the scene. This involves translation (position) and rotation (orientation). Mathematically, these transformations can be represented using quaternions (`sofa::type::Quat<SReal>`) for rotations and vectors (`sofa::type::Vec3`) for translations.\n- **Movement**: The `moveView` method allows for incremental changes to the camera's position. This could involve translating by a given vector or rotating around an axis by a specified angle.\n\n#### 2. Scene Rendering:\n- **Rendering Loop**: The `drawScene` method defines the primary rendering loop where the scene is visualized based on the current state of the simulation, including object positions and appearances. This involves transformations (model-view-projection), lighting calculations, texturing, and possibly post-processing effects.\n\n#### 3. Interaction:\n- **Ray Casting**: The `moveRayPickInteractor` method is a placeholder for ray-casting functionality used in interactivity (e.g., picking objects within the scene). Ray casting involves projecting a line (ray) from the camera's position through the screen to intersect with scene elements.\n\n#### 4. Scene Management:\n- **Scene Handling**: Methods like `getScene`, `setSceneFileName`, and `setScene` handle the loading and unloading of simulation scenes, which are represented by nodes in Sofa’s simulation tree (`sofa::simulation::Node`). This involves file I/O operations and scene graph management.\n\n#### 5. Selection Mechanism:\n- **Selection Management**: The `setCurrentSelection` and `getCurrentSelection` methods manage a set of selected objects within the scene, allowing for interaction with specific parts of the simulation in a detailed manner. The `drawSelection` method visualizes these selections by drawing additional graphics like text or outlines around selected objects.\n\n#### 6. Scene Camera Settings:\n- **Camera Mode**: The `setCameraMode` function configures the camera behavior, which could impact how transformations and view settings are applied during rendering.\n\n### Physical Description:\nThis class does not directly deal with physical simulations but serves as a critical interface for visualizing them. It ensures that any viewer implementing this base class can provide consistent functionality such as navigation through the scene (view manipulation), interaction (object selection, picking), and control over aspects like background color or image settings. The methods provided facilitate operations necessary for creating an interactive, user-friendly environment for simulating physical phenomena, ensuring developers have a standard way to visualize their simulations."
},
"summary": {
"abstract": "`BaseViewer` is an abstract base class defining the interface for GUI viewers in SOFA, providing methods for scene management, camera control, and rendering.",
"sheet": "# BaseViewer\n\n**Overview**\n`BaseViewer` serves as an abstract base class that defines the interface for GUI viewers within the SOFA framework. It provides a set of methods to manage scenes, handle camera settings, and perform rendering operations.\n\n**Parameters and Data**\nThe `BaseViewer` class does not expose any significant data fields or parameters directly; its functionality is primarily defined through method implementations in derived classes.\n\n**Dependencies and Connections**\n`BaseViewer` typically requires interaction with other SOFA components such as scene nodes (`sofa::simulation::Node`) for loading scenes, visual parameters (`sofa::core::visual::VisualParams`), and interactor mechanisms. It fits into the scene graph by providing a uniform interface for visualization.\n\n**Practical Notes**\nThe `BaseViewer` class is intended to be inherited from in concrete viewer implementations (e.g., OpenGL viewers). Developers must implement pure virtual methods such as `drawScene`, `viewAll`, and `redraw`. Care should be taken when configuring camera modes and handling scene loading/unloading operations for consistency across different viewer types."
}
}