A view of a model contained in a project file can contain the discipline property, which determines what kind of elements are shown in the view.
The discipline property is represented with the ViewDiscipline enumeration and can accept the following values:
- Architectural
- Coordination
- Electrical
- Mechanical
- Plumbing
- Structural
When the discipline property is equal to the Architectural or Coordination value, the view shows all elements; for the Structural value, non-structural walls are filtered within the view.
The Electrical, Mechanical, and Plumbing values assume that corresponding elements are shown when rendering the appropriate view. Views with these disciplines are named system because there is no remarkable difference between their rendering disciplines. The rendering algorithm for these view types draws system elements of the project (mechanical, electrical, plumbing) by applying their corresponding visual styles. Other elements are rendered in hidden line mode and are placed below the system elements.
The example below illustrates how a view is rendered in the OdaBimApp sample application with different disciplines.
The view contains:
- Structural and non-structural walls (associated with architectural and structural disciplines)
- Text associated with all categories
- Pipe fitting associated with plumbing
When the structural discipline is applied to the view, only structural walls, fitting, and text are rendered; non-structural walls are hidden:
For the mechanical discipline, the pipe fitting is drawn above the wall, and other elements are rendered in hidden line mode:
View Discipline Support
The OdBmCategory class includes the methodOdInt32 getDisciplines() for working with view disciplines. This method returns a bitmask that contains the view disciplines associated with a category.
Each category can be associated with several view disciplines. If the category is associated with at least one Electrical, Mechanical, or Plumbing discipline, it is considered to be a system category, excluding the case when the category is associated with all disciplines defined within the ViewDiscipline enumeration.
The OdGsView layer renders the view with disciplines, so there are three GS views created for each view/viewport rendering operation:
- A front view with annotations
- A back view with non-system elements for system views (for non-system views, the GS view is created but remains empty)
- The main view for all other elements
All BimRv class methods that set a GS view have a parameter that represents the back view. The back view is configured to draw all elements in hidden line mode and below the elements rendered for the main view.
Non-structural walls are filtered for structural view rendering.