run: |
git diff > format.patch
if ((Get-Item format.patch).length -gt 0) {
- echo "::error::Files need formatting. To fix: 1. Download format.patch 2. \"git apply format.patch\" 3. Commit and push"
echo "has_changes=true" >> $env:GITHUB_OUTPUT
- exit 1
}
- name: Upload patch
name: format-patch
path: format.patch
+ - name: Failing step for formatting issues
+ if: steps.git-check.outputs.has_changes == 'true'
+ shell: pwsh
+ run: |
+ echo "::error::Files need formatting. To fix: 1. Download format.patch 2. \"git apply format.patch\" 3. Commit and push"
+ exit 1
+
branding:
icon: 'check-square'
color: 'green'
IMPLEMENT_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
-// =======================================================================
-// function : AIS_GlobalStatus
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_GlobalStatus::AIS_GlobalStatus()
: myDispMode(0),
myIsHilit(Standard_False),
}
}
-// =======================================================================
-// function : SetSelectedState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean AIS_InteractiveContext::SetSelectedState(
const Handle(SelectMgr_EntityOwner)& theEntity,
const Standard_Boolean theIsSelected)
(*aStat)->AddSelectionMode(theMode);
}
-// ============================================================================
-// function : Activate
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void AIS_InteractiveContext::Activate(const Standard_Integer theMode,
const Standard_Boolean theIsForce)
{
}
}
-// ============================================================================
-// function : Deactivate
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void AIS_InteractiveContext::Deactivate(const Standard_Integer theMode)
{
AIS_ListOfInteractive aDisplayedObjects;
}
}
-// ============================================================================
-// function : Deactivate
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void AIS_InteractiveContext::Deactivate()
{
AIS_ListOfInteractive aDisplayedObjects;
IMPLEMENT_STANDARD_RTTIEXT(AIS_LightSource, AIS_InteractiveObject)
IMPLEMENT_STANDARD_RTTIEXT(AIS_LightSourceOwner, SelectMgr_EntityOwner)
-// =======================================================================
-// function : AIS_LightSourceOwner
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_LightSourceOwner::AIS_LightSourceOwner(const Handle(AIS_LightSource)& theObject,
Standard_Integer thePriority)
: SelectMgr_EntityOwner((const Handle(SelectMgr_SelectableObject)&)theObject, thePriority)
//
}
-// =======================================================================
-// function : HandleMouseClick
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean AIS_LightSourceOwner::HandleMouseClick(const Graphic3d_Vec2i&,
Aspect_VKeyMouse theKey,
Aspect_VKeyFlags theFlags,
return Standard_False;
}
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_LightSource::AIS_LightSource(const Handle(Graphic3d_CLight)& theLight)
: myLightSource(theLight),
myCodirMarkerType(Aspect_TOM_X),
return Standard_False;
}
-// =======================================================================
-// function : updateLightAspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::updateLightAspects()
{
const Quantity_Color aBaseColor = myLightSource->Color();
SynchronizeAspects();
}
-// =======================================================================
-// function : updateLightTransformPersistence
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::updateLightTransformPersistence()
{
Handle(Graphic3d_TransformPers) aTrsfPers = myTransformPersistence;
SetTransformPersistence(aTrsfPers);
}
-// =======================================================================
-// function : updateLightLocalTransformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::updateLightLocalTransformation()
{
myLocalTransformation.Nullify();
UpdateTransformation();
}
-// =======================================================================
-// function : setLocalTransformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::setLocalTransformation(const Handle(TopLoc_Datum3D)& theTrsf)
{
const gp_Trsf aTrsf = !theTrsf.IsNull() ? theTrsf->Transformation() : gp_Trsf();
updateLightTransformPersistence();
}
-// =======================================================================
-// function : Compute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::Compute(const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
}
}
-// =======================================================================
-// function : computeAmbient
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::computeAmbient(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
}
}
-// =======================================================================
-// function : computeDirectional
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::computeDirectional(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
}
}
-// =======================================================================
-// function : computePositional
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::computePositional(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
}
}
-// =======================================================================
-// function : computeSpot
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::computeSpot(const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
}
}
-// =======================================================================
-// function : ComputeSelection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_LightSource::ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
myFramePair.Nullify();
}
-// =======================================================================
-// function : OpenInput
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_MediaPlayer::OpenInput(const TCollection_AsciiString& thePath, Standard_Boolean theToWait)
{
if (myFramePair->PlayerContext().IsNull() && thePath.IsEmpty())
SynchronizeAspects();
}
-// =======================================================================
-// function : PresentFrame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_MediaPlayer::PresentFrame(const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize)
{
return toRedraw;
}
-// =======================================================================
-// function : updateSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_MediaPlayer::updateSize(const Graphic3d_Vec2i& theLeftCorner,
const Graphic3d_Vec2i& theMaxSize)
{
return true;
}
-// =======================================================================
-// function : PlayPause
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_MediaPlayer::PlayPause()
{
if (myFramePair->PlayerContext().IsNull())
myFramePair->PlayerContext()->PlayPause(isPaused, aProgress, aDuration);
}
-// =======================================================================
-// function : Compute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_MediaPlayer::Compute(const Handle(PrsMgr_PresentationManager)&,
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
}
}
-// =======================================================================
-// function : ComputeSelection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_MediaPlayer::ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
const Standard_Integer theMode)
{
return Handle(Select3D_SensitiveEntity)();
}
-// =======================================================================
-// function : updatePrimitives
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_Trihedron::updatePrimitives(const Handle(Prs3d_DatumAspect)& theAspect,
Prs3d_DatumMode theMode,
const gp_Pnt& theOrigin,
IMPLEMENT_STANDARD_RTTIEXT(AIS_TrihedronOwner, SelectMgr_EntityOwner)
-// =======================================================================
-// function : AIS_TrihedronOwner
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_TrihedronOwner::AIS_TrihedronOwner(const Handle(SelectMgr_SelectableObject)& theSelObject,
const Prs3d_DatumParts thePart,
const Standard_Integer thePriority)
{
}
-// =======================================================================
-// function : HilightWithColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_TrihedronOwner::HilightWithColor(const Handle(PrsMgr_PresentationManager)& thePM,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer /*theMode*/)
Selectable()->HilightOwnerWithColor(thePM, theStyle, this);
}
-// =======================================================================
-// function : IsHilighted
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean AIS_TrihedronOwner::IsHilighted(const Handle(PrsMgr_PresentationManager)& thePM,
const Standard_Integer theMode) const
{
return thePM->IsHighlighted(Selectable(), theMode);
}
-// =======================================================================
-// function : Unhilight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_TrihedronOwner::Unhilight(const Handle(PrsMgr_PresentationManager)& thePM,
const Standard_Integer theMode)
{
#include <V3d_Viewer.hxx>
#include <WNT_HIDSpaceMouse.hxx>
-// =======================================================================
-// function : AIS_ViewController
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_ViewController::AIS_ViewController()
: myLastEventsTime(0.0),
myToAskNextFrame(false),
myXRSelectHaptic.Amplitude = 0.5f;
}
-// =======================================================================
-// function : ~AIS_ViewController
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_ViewController::~AIS_ViewController()
{
//
}
-// =======================================================================
-// function : ResetViewInput
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::ResetViewInput()
{
myKeys.Reset();
myMouseClickCounter = 0;
}
-// =======================================================================
-// function : FlushViewEvents
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::FlushViewEvents(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
Standard_Boolean theToHandle)
}
}
-// =======================================================================
-// function : flushBuffers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::flushBuffers(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)&)
{
}
}
-// =======================================================================
-// function : flushGestures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::flushGestures(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : UpdateViewOrientation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::UpdateViewOrientation(V3d_TypeOfOrientation theOrientation,
bool theToFitAll)
{
myUI.Orientation.ViewOrient = theOrientation;
}
-// =======================================================================
-// function : SelectInViewer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::SelectInViewer(const Graphic3d_Vec2i& thePnt,
const AIS_SelectionScheme theScheme)
{
myUI.Selection.Points.Append(thePnt);
}
-// =======================================================================
-// function : SelectInViewer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::SelectInViewer(const NCollection_Sequence<Graphic3d_Vec2i>& thePnts,
const AIS_SelectionScheme theScheme)
{
}
}
-// =======================================================================
-// function : UpdateRubberBand
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::UpdateRubberBand(const Graphic3d_Vec2i& thePntFrom,
const Graphic3d_Vec2i& thePntTo)
{
myUI.Selection.Points.Append(thePntTo);
}
-// =======================================================================
-// function : UpdatePolySelection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::UpdatePolySelection(const Graphic3d_Vec2i& thePnt, bool theToAppend)
{
if (myUI.Selection.Tool != AIS_ViewSelectionTool_Polygon)
}
}
-// =======================================================================
-// function : UpdateZoom
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::UpdateZoom(const Aspect_ScrollDelta& theDelta)
{
if (!myUI.ZoomActions.IsEmpty())
return true;
}
-// =======================================================================
-// function : UpdateZRotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::UpdateZRotation(double theAngle)
{
if (!ToAllowTouchZRotation())
return true;
}
-// =======================================================================
-// function : UpdateMouseScroll
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::UpdateMouseScroll(const Aspect_ScrollDelta& theDelta)
{
Aspect_ScrollDelta aDelta = theDelta;
return UpdateZoom(aDelta);
}
-// =======================================================================
-// function : UpdateMouseClick
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::UpdateMouseClick(const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
return false;
}
-// =======================================================================
-// function : UpdateMouseButtons
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::UpdateMouseButtons(const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButtons,
Aspect_VKeyFlags theModifiers,
return toUpdateView;
}
-// =======================================================================
-// function : UpdateMousePosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::UpdateMousePosition(const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButtons,
Aspect_VKeyFlags theModifiers,
return toUpdateView;
}
-// =======================================================================
-// function : AddTouchPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::AddTouchPoint(Standard_Size theId,
const Graphic3d_Vec2d& thePnt,
Standard_Boolean theClearBefore)
myUI.IsNewGesture = true;
}
-// =======================================================================
-// function : RemoveTouchPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::RemoveTouchPoint(Standard_Size theId, Standard_Boolean theClearSelectPnts)
{
if (!Aspect_WindowInputListener::RemoveTouchPoint(theId, theClearSelectPnts))
return true;
}
-// =======================================================================
-// function : UpdateTouchPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::UpdateTouchPoint(Standard_Size theId, const Graphic3d_Vec2d& thePnt)
{
Aspect_WindowInputListener::UpdateTouchPoint(theId, thePnt);
}
}
-// =======================================================================
-// function : Update3dMouse
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::Update3dMouse(const WNT_HIDSpaceMouse& theEvent)
{
bool toUpdate = false;
return toUpdate;
}
-// =======================================================================
-// function : SetNavigationMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::SetNavigationMode(AIS_NavigationMode theMode)
{
myNavigationMode = theMode;
myUI.ViewRotation.ToRotate = false;
}
-// =======================================================================
-// function : KeyDown
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::KeyDown(Aspect_VKey theKey, double theTime, double thePressure)
{
Aspect_WindowInputListener::KeyDown(theKey, theTime, thePressure);
}
-// =======================================================================
-// function : KeyUp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::KeyUp(Aspect_VKey theKey, double theTime)
{
Aspect_WindowInputListener::KeyUp(theKey, theTime);
}
-// =======================================================================
-// function : KeyFromAxis
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::KeyFromAxis(Aspect_VKey theNegative,
Aspect_VKey thePositive,
double theTime,
Aspect_WindowInputListener::KeyFromAxis(theNegative, thePositive, theTime, thePressure);
}
-// =======================================================================
-// function : FetchNavigationKeys
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_WalkDelta AIS_ViewController::FetchNavigationKeys(Standard_Real theCrouchRatio,
Standard_Real theRunRatio)
{
return aWalk;
}
-// =======================================================================
-// function : AbortViewAnimation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::AbortViewAnimation()
{
if (!myViewAnimation.IsNull() && !myViewAnimation->IsStopped())
}
}
-// =======================================================================
-// function : handlePanning
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handlePanning(const Handle(V3d_View)& theView)
{
if (!myGL.Panning.ToPan || !myToAllowPanning)
theView->View()->SynchronizeXRPosedToBaseCamera();
}
-// =======================================================================
-// function : handleZRotate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleZRotate(const Handle(V3d_View)& theView)
{
if (!myGL.ZRotate.ToRotate || !myToAllowRotation)
theView->View()->SynchronizeXRPosedToBaseCamera();
}
-// =======================================================================
-// function : handleZoom
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleZoom(const Handle(V3d_View)& theView,
const Aspect_ScrollDelta& theParams,
const gp_Pnt* thePnt)
theView->View()->SynchronizeXRPosedToBaseCamera();
}
-// =======================================================================
-// function : handleZFocusScroll
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleZFocusScroll(const Handle(V3d_View)& theView,
const Aspect_ScrollDelta& theParams)
{
}
}
-// =======================================================================
-// function : handleOrbitRotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleOrbitRotation(const Handle(V3d_View)& theView,
const gp_Pnt& thePnt,
bool theToLockZUp)
theView->View()->SynchronizeXRBaseToPosedCamera();
}
-// =======================================================================
-// function : handleViewRotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleViewRotation(const Handle(V3d_View)& theView,
double theYawExtra,
double thePitchExtra,
theView->Invalidate();
}
-// =======================================================================
-// function : PickPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::PickPoint(gp_Pnt& thePnt,
const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
&& !Precision::IsInfinite(thePnt.Z());
}
-// =======================================================================
-// function : PickAxis
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool AIS_ViewController::PickAxis(gp_Pnt& theTopPnt,
const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
&& !Precision::IsInfinite(theTopPnt.Z());
}
-// =======================================================================
-// function : GravityPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt AIS_ViewController::GravityPoint(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
return theCtx->GravityPoint(theView);
}
-// =======================================================================
-// function : FitAllAuto
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::FitAllAuto(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleViewOrientationKeys
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleViewOrientationKeys(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleNavigationKeys
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AIS_WalkDelta AIS_ViewController::handleNavigationKeys(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
return aWalk;
}
-// =======================================================================
-// function : handleCameraActions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleCameraActions(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const AIS_WalkDelta& theWalk)
}
}
-// =======================================================================
-// function : handleXRInput
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleXRInput(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const AIS_WalkDelta&)
handleXRPicking(theCtx, theView);
}
-// =======================================================================
-// function : handleXRTurnPad
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleXRTurnPad(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleXRTeleport
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleXRTeleport(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleXRPicking
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleXRPicking(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : OnSelectionChanged
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::OnSelectionChanged(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)&)
{
//
}
-// =======================================================================
-// function : OnSubviewChanged
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::OnSubviewChanged(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)&,
const Handle(V3d_View)&)
//
}
-// =======================================================================
-// function : OnObjectDragged
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::OnObjectDragged(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
AIS_DragAction theAction)
}
}
-// =======================================================================
-// function : contextLazyMoveTo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::contextLazyMoveTo(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const Graphic3d_Vec2i& thePnt)
}
}
-// =======================================================================
-// function : handleSelectionPick
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleSelectionPick(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleSelectionPoly
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleSelectionPoly(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleDynamicHighlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleDynamicHighlight(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleMoveTo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleMoveTo(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
handleSelectionPoly(theCtx, theView);
}
-// =======================================================================
-// function : handleViewRedraw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleViewRedraw(const Handle(AIS_InteractiveContext)&,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleXRMoveTo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer AIS_ViewController::handleXRMoveTo(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView,
const gp_Trsf& thePose,
return aPickResult;
}
-// =======================================================================
-// function : handleXRHighlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleXRHighlight(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : handleXRPresentations
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::handleXRPresentations(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
}
}
-// =======================================================================
-// function : HandleViewEvents
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void AIS_ViewController::HandleViewEvents(const Handle(AIS_InteractiveContext)& theCtx,
const Handle(V3d_View)& theView)
{
return (MyColor);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_Background::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, Aspect_Background)
IMPLEMENT_STANDARD_RTTIEXT(Aspect_DisplayConnection, Standard_Transient)
-// =======================================================================
-// function : Aspect_DisplayConnection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_DisplayConnection::Aspect_DisplayConnection()
{
#if defined(HAVE_XLIB)
#endif
}
-// =======================================================================
-// function : ~Aspect_DisplayConnection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_DisplayConnection::~Aspect_DisplayConnection()
{
#if defined(HAVE_XLIB)
#endif
}
-// =======================================================================
-// function : Aspect_DisplayConnection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_DisplayConnection::Aspect_DisplayConnection(const TCollection_AsciiString& theDisplayName)
: myDisplay(NULL),
myDefVisualInfo(NULL),
Init(NULL);
}
-// =======================================================================
-// function : Aspect_DisplayConnection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_DisplayConnection::Aspect_DisplayConnection(Aspect_XDisplay* theDisplay)
: myDisplay(NULL),
myDefVisualInfo(NULL),
Init(theDisplay);
}
-// =======================================================================
-// function : SetDefaultVisualInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_DisplayConnection::SetDefaultVisualInfo(Aspect_XVisualInfo* theVisual,
Aspect_FBConfig theFBConfig)
{
myDefFBConfig = theFBConfig;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_DisplayConnection::Init(Aspect_XDisplay* theDisplay)
{
#if defined(HAVE_XLIB)
#include <Standard_Dump.hxx>
-// =======================================================================
-// function : Aspect_GenId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_GenId::Aspect_GenId()
: myFreeCount(INT_MAX / 2 + 1),
myLength(INT_MAX / 2 + 1),
//
}
-// =======================================================================
-// function : Aspect_GenId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_GenId::Aspect_GenId(const Standard_Integer theLow, const Standard_Integer theUpper)
: myFreeCount(theUpper - theLow + 1),
myLength(theUpper - theLow + 1),
}
}
-// =======================================================================
-// function : Free
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_GenId::Free()
{
myFreeCount = myLength;
myFreeIds.Clear();
}
-// =======================================================================
-// function : Free
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_GenId::Free(const Standard_Integer theId)
{
if (theId >= myLowerBound && theId <= myUpperBound)
}
}
-// =======================================================================
-// function : Next
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Aspect_GenId::Next()
{
Standard_Integer aNewId = 0;
return aNewId;
}
-// =======================================================================
-// function : Next
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Aspect_GenId::Next(Standard_Integer& theId)
{
if (!myFreeIds.IsEmpty())
return Standard_True;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_GenId::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myFreeCount)
return MyGradientMethod;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_GradientBackground::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
IMPLEMENT_STANDARD_RTTIEXT(Aspect_NeutralWindow, Aspect_Window)
-// =======================================================================
-// function : Aspect_NeutralWindow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_NeutralWindow::Aspect_NeutralWindow()
: myHandle(0),
myParentHandle(0),
{
}
-// =======================================================================
-// function : SetNativeHandles
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Aspect_NeutralWindow::SetNativeHandles(Aspect_Drawable theWindow,
Aspect_Drawable theParentWindow,
Aspect_FBConfig theFbConfig)
return Standard_True;
}
-// =======================================================================
-// function : SetPosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Aspect_NeutralWindow::SetPosition(Standard_Integer theX1, Standard_Integer theY1)
{
if (myPosX == theX1 && myPosY == theY1)
return Standard_True;
}
-// =======================================================================
-// function : SetPosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Aspect_NeutralWindow::SetPosition(Standard_Integer theX1,
Standard_Integer theY1,
Standard_Integer theX2,
return Standard_True;
}
-// =======================================================================
-// function : SetSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Aspect_NeutralWindow::SetSize(const Standard_Integer theWidth,
const Standard_Integer theHeight)
{
};
#endif
-// =======================================================================
-// function : IsHmdPresent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_OpenVRSession::IsHmdPresent()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : defaultActionsManifest
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Aspect_OpenVRSession::defaultActionsManifest()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : Aspect_OpenVRSession
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_OpenVRSession::Aspect_OpenVRSession()
: myContext(new VRContext())
{
#endif
}
-// =======================================================================
-// function : ~Aspect_OpenVRSession
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_OpenVRSession::~Aspect_OpenVRSession()
{
closeVR();
delete myContext;
}
-// =======================================================================
-// function : closeVR
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::closeVR()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : getVRSystem
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void* Aspect_OpenVRSession::getVRSystem() const
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : Close
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::Close()
{
closeVR();
}
-// =======================================================================
-// function : IsOpen
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_OpenVRSession::IsOpen() const
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : Open
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_OpenVRSession::Open()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : initInput
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_OpenVRSession::initInput()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : GetString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Aspect_OpenVRSession::GetString(InfoString theInfo) const
{
#ifdef HAVE_OPENVR
return TCollection_AsciiString();
}
-// =======================================================================
-// function : NamedTrackedDevice
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Aspect_OpenVRSession::NamedTrackedDevice(
Aspect_XRTrackedDeviceRole theDevice) const
{
return -1;
}
-// =======================================================================
-// function : loadRenderModel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfTriangles) Aspect_OpenVRSession::loadRenderModel(
Standard_Integer theDevice,
Standard_Boolean theToApplyUnitFactor,
#endif
}
-// =======================================================================
-// function : EyeToHeadTransform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
NCollection_Mat4<double> Aspect_OpenVRSession::EyeToHeadTransform(Aspect_Eye theEye) const
{
#ifdef HAVE_OPENVR
return NCollection_Mat4<double>();
}
-// =======================================================================
-// function : ProjectionMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
NCollection_Mat4<double> Aspect_OpenVRSession::ProjectionMatrix(Aspect_Eye theEye,
double theZNear,
double theZFar) const
return NCollection_Mat4<double>();
}
-// =======================================================================
-// function : updateProjectionFrustums
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::updateProjectionFrustums()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : SetTrackingOrigin
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::SetTrackingOrigin(TrackingUniverseOrigin theOrigin)
{
#ifdef HAVE_OPENVR
myTrackOrigin = theOrigin;
}
-// =======================================================================
-// function : WaitPoses
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_OpenVRSession::WaitPoses()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : GetDigitalActionData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_XRDigitalActionData Aspect_OpenVRSession::GetDigitalActionData(
const Handle(Aspect_XRAction)& theAction) const
{
return anActionData;
}
-// =======================================================================
-// function : GetAnalogActionData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_XRAnalogActionData Aspect_OpenVRSession::GetAnalogActionData(
const Handle(Aspect_XRAction)& theAction) const
{
return anActionData;
}
-// =======================================================================
-// function : GetPoseActionDataForNextFrame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_XRPoseActionData Aspect_OpenVRSession::GetPoseActionDataForNextFrame(
const Handle(Aspect_XRAction)& theAction) const
{
return anActionData;
}
-// =======================================================================
-// function : triggerHapticVibrationAction
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::triggerHapticVibrationAction(const Handle(Aspect_XRAction)& theAction,
const Aspect_XRHapticActionData& theParams)
{
#endif
}
-// =======================================================================
-// function : ProcessEvents
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::ProcessEvents()
{
#ifdef HAVE_OPENVR
#endif
}
-// =======================================================================
-// function : onTrackedDeviceActivated
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::onTrackedDeviceActivated(Standard_Integer theDeviceIndex)
{
Message::SendTrace(TCollection_AsciiString("OpenVR, Device ") + theDeviceIndex + " attached");
}
-// =======================================================================
-// function : onTrackedDeviceDeactivated
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::onTrackedDeviceDeactivated(Standard_Integer theDeviceIndex)
{
Message::SendTrace(TCollection_AsciiString("OpenVR, Device ") + theDeviceIndex + " detached");
}
-// =======================================================================
-// function : onTrackedDeviceUpdated
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_OpenVRSession::onTrackedDeviceUpdated(Standard_Integer theDeviceIndex)
{
Message::SendTrace(TCollection_AsciiString("OpenVR, Device ") + theDeviceIndex + " updated");
}
-// =======================================================================
-// function : SubmitEye
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_OpenVRSession::SubmitEye(void* theTexture,
Aspect_GraphicsLibrary theGraphicsLib,
Aspect_ColorSpace theColorSpace,
#include <Standard_RangeError.hxx>
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_SkydomeBackground::Aspect_SkydomeBackground()
: mySunDirection(0.0f, 1.0f, 0.0f),
myCloudiness(0.2f),
//
}
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_SkydomeBackground::Aspect_SkydomeBackground(const gp_Dir& theSunDirection,
Standard_ShortReal theCloudiness,
Standard_ShortReal theTime,
"Aspect_SkydomeBackground::Aspect_SkydomeBackground() theSize must be > 0");
}
-// =======================================================================
-// function : ~Aspect_SkydomeBackground
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_SkydomeBackground::~Aspect_SkydomeBackground()
{
//
}
-// =======================================================================
-// function : SetCloudiness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_SkydomeBackground::SetCloudiness(Standard_ShortReal theCloudiness)
{
Standard_RangeError_Raise_if(
myCloudiness = theCloudiness;
}
-// =======================================================================
-// function : SetFogginess
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_SkydomeBackground::SetFogginess(Standard_ShortReal theFogginess)
{
Standard_RangeError_Raise_if(theFogginess < 0,
myFogginess = theFogginess;
}
-// =======================================================================
-// function : SetSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_SkydomeBackground::SetSize(Standard_Integer theSize)
{
Standard_RangeError_Raise_if(theSize <= 0,
mySize = theSize;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_SkydomeBackground::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
IMPLEMENT_STANDARD_RTTIEXT(Aspect_VKeySet, Standard_Transient)
-// ================================================================
-// Function : As1pect_VKeySet
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Aspect_VKeySet::Aspect_VKeySet()
: myKeys(0, Aspect_VKey_MAX),
myModifiers(Aspect_VKeyFlags_NONE)
//
}
-// ================================================================
-// Function : Reset
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void Aspect_VKeySet::Reset()
{
Standard_Mutex::Sentry aLock(myLock);
}
}
-// ================================================================
-// Function : KeyDown
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void Aspect_VKeySet::KeyDown(Aspect_VKey theKey, double theTime, double thePressure)
{
Standard_Mutex::Sentry aLock(myLock);
myModifiers = myModifiers | aModif;
}
-// ================================================================
-// Function : KeyUp
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void Aspect_VKeySet::KeyUp(Aspect_VKey theKey, double theTime)
{
Standard_Mutex::Sentry aLock(myLock);
}
}
-// ================================================================
-// Function : KeyFromAxis
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void Aspect_VKeySet::KeyFromAxis(Aspect_VKey theNegative,
Aspect_VKey thePositive,
double theTime,
}
}
-// ================================================================
-// Function : HoldDuration
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool Aspect_VKeySet::HoldDuration(Aspect_VKey theKey,
double theTime,
double& theDuration,
#include <WNT_HIDSpaceMouse.hxx>
-// =======================================================================
-// function : Aspect_WindowInputListener
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_WindowInputListener::Aspect_WindowInputListener()
: myMousePressed(Aspect_VKeyMouse_NONE),
myMouseModifiers(Aspect_VKeyFlags_NONE),
myEventTimer.Start();
}
-// =======================================================================
-// function : ~Aspect_WindowInputListener
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_WindowInputListener::~Aspect_WindowInputListener()
{
//
}
-// =======================================================================
-// function : KeyDown
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_WindowInputListener::KeyDown(Aspect_VKey theKey, double theTime, double thePressure)
{
myKeys.KeyDown(theKey, theTime, thePressure);
}
-// =======================================================================
-// function : KeyUp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_WindowInputListener::KeyUp(Aspect_VKey theKey, double theTime)
{
myKeys.KeyUp(theKey, theTime);
}
-// =======================================================================
-// function : KeyFromAxis
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_WindowInputListener::KeyFromAxis(Aspect_VKey theNegative,
Aspect_VKey thePositive,
double theTime,
myKeys.KeyFromAxis(theNegative, thePositive, theTime, thePressure);
}
-// =======================================================================
-// function : AddTouchPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_WindowInputListener::AddTouchPoint(Standard_Size theId,
const Graphic3d_Vec2d& thePnt,
Standard_Boolean theClearBefore)
myTouchPoints.Add(theId, Aspect_Touch(thePnt, false));
}
-// =======================================================================
-// function : RemoveTouchPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_WindowInputListener::RemoveTouchPoint(Standard_Size theId,
Standard_Boolean theClearSelectPnts)
{
return true;
}
-// =======================================================================
-// function : UpdateTouchPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_WindowInputListener::UpdateTouchPoint(Standard_Size theId,
const Graphic3d_Vec2d& thePnt)
{
}
}
-// =======================================================================
-// function : update3dMouseTranslation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_WindowInputListener::update3dMouseTranslation(const WNT_HIDSpaceMouse& theEvent)
{
if (!theEvent.IsTranslation())
return true;
}
-// =======================================================================
-// function : update3dMouseRotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_WindowInputListener::update3dMouseRotation(const WNT_HIDSpaceMouse& theEvent)
{
if (!theEvent.IsRotation())
return toUpdate;
}
-// =======================================================================
-// function : update3dMouseKeys
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Aspect_WindowInputListener::update3dMouseKeys(const WNT_HIDSpaceMouse& theEvent)
{
bool toUpdate = false;
IMPLEMENT_STANDARD_RTTIEXT(Aspect_XRAction, Standard_Transient)
IMPLEMENT_STANDARD_RTTIEXT(Aspect_XRActionSet, Standard_Transient)
-// =======================================================================
-// function : Aspect_XRSession
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_XRSession::Aspect_XRSession()
: myTrackOrigin(TrackingUniverseOrigin_Standing),
myTrackedPoses(0, 0),
}
}
-// =======================================================================
-// function : AbortHapticVibrationAction
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_XRSession::AbortHapticVibrationAction(const Handle(Aspect_XRAction)& theAction)
{
triggerHapticVibrationAction(theAction, Aspect_XRHapticActionData());
}
-// =======================================================================
-// function : TriggerHapticVibrationAction
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Aspect_XRSession::TriggerHapticVibrationAction(const Handle(Aspect_XRAction)& theAction,
const Aspect_XRHapticActionData& theParams)
{
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
-// ================================================================================
-// function: Constructor
-// purpose:
-// ================================================================================
+//=================================================================================================
+
BOPAlgo_ArgumentAnalyzer::BOPAlgo_ArgumentAnalyzer()
: BOPAlgo_Algo(),
myStopOnFirst(Standard_False),
myResult.Clear();
}
-// ================================================================================
-// function: SetShape1
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::SetShape1(const TopoDS_Shape& TheShape)
{
myShape1 = TheShape;
}
-// ================================================================================
-// function: SetShape2
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::SetShape2(const TopoDS_Shape& TheShape)
{
myShape2 = TheShape;
}
-// ================================================================================
-// function: GetShape1
-// purpose:
-// ================================================================================
+//=================================================================================================
+
const TopoDS_Shape& BOPAlgo_ArgumentAnalyzer::GetShape1() const
{
return myShape1;
}
-// ================================================================================
-// function: GetShape2
-// purpose:
-// ================================================================================
+//=================================================================================================
+
const TopoDS_Shape& BOPAlgo_ArgumentAnalyzer::GetShape2() const
{
return myShape2;
}
-// ================================================================================
-// function: OperationType
-// purpose:
-// ================================================================================
+//=================================================================================================
+
BOPAlgo_Operation& BOPAlgo_ArgumentAnalyzer::OperationType()
{
return myOperation;
}
-// ================================================================================
-// function: StopOnFirstFaulty
-// purpose:
-// ================================================================================
+//=================================================================================================
+
Standard_Boolean& BOPAlgo_ArgumentAnalyzer::StopOnFirstFaulty()
{
return myStopOnFirst;
}
-// ================================================================================
-// function: Prepare
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::Prepare()
{
Standard_Boolean isS1 = myShape1.IsNull(), isS2 = myShape2.IsNull();
}
}
-// ================================================================================
-// function: Perform
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange)
{
Message_ProgressScope aPS(theRange, "Analyze shapes", 10);
}
}
-// ================================================================================
-// function: HasFaulty
-// purpose:
-// ================================================================================
+//=================================================================================================
+
Standard_Boolean BOPAlgo_ArgumentAnalyzer::HasFaulty() const
{
return (!myResult.IsEmpty());
}
-// ================================================================================
-// function: GetCheckResult
-// purpose:
-// ================================================================================
+//=================================================================================================
+
const BOPAlgo_ListOfCheckResult& BOPAlgo_ArgumentAnalyzer::GetCheckResult() const
{
return myResult;
}
-// ================================================================================
-// function: TestTypes
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestTypes()
{
Standard_Boolean isS1 = myShape1.IsNull(), isS2 = myShape2.IsNull();
} // for(ii = 0; ii < 2; ii++) {
}
-// ================================================================================
-// function: TestSmallEdge
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestSmallEdge()
{
Standard_Integer i = 0;
}
}
-// ================================================================================
-// function: TestRebuildFace
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestRebuildFace()
{
if ((myOperation == BOPAlgo_SECTION) || (myOperation == BOPAlgo_UNKNOWN))
}
}
-// ================================================================================
-// function: TestTangent
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestTangent()
{
// not implemented
}
-// ================================================================================
-// function: TestMergeSubShapes
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestMergeSubShapes(const TopAbs_ShapeEnum theType)
{
if (myShape1.IsNull() || myShape2.IsNull())
}
}
-// ================================================================================
-// function: TestMergeVertex
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestMergeVertex()
{
TestMergeSubShapes(TopAbs_VERTEX);
}
-// ================================================================================
-// function: TestMergeEdge
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestMergeEdge()
{
TestMergeSubShapes(TopAbs_EDGE);
}
-// ================================================================================
-// function: TestContinuity
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestContinuity()
{
Standard_Integer i, j, aNbS;
}
}
-// ================================================================================
-// function: TestCurveOnSurface
-// purpose:
-// ================================================================================
+//=================================================================================================
+
void BOPAlgo_ArgumentAnalyzer::TestCurveOnSurface()
{
Standard_Integer i;
}
};
-// =======================================================================
-// function : sign
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real sign(const BVH_Vec3d& theVertex0,
const BVH_Vec3d& theVertex1,
const BVH_Vec3d& theVertex2,
- (theVertex1[theX] - theVertex2[theX]) * (theVertex0[theY] - theVertex2[theY]);
}
-// =======================================================================
-// function : pointInTriangle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean pointInTriangle(const BVH_Vec3d& theTestPnt,
const BVH_Vec3d& theTrgVtx0,
const BVH_Vec3d& theTrgVtx1,
&& ccw(ZERO_VEC, theDirec, theEdge1, theX, theY) == aCCW;
}
-// =======================================================================
-// function : getProjectionAxes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void getProjectionAxes(const BVH_Vec3d& theNorm,
Standard_Integer& theAxisX,
Standard_Integer& theAxisY)
TopoDS_Vertex& theVertex,
const Standard_Real theParam);
-// ===========================================================================================
-// function: Constructor
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
BRepFill_TrimShellCorner::BRepFill_TrimShellCorner(const Handle(TopTools_HArray2OfShape)& theFaces,
const BRepFill_TransitionStyle theTransition,
const gp_Ax2& theAxeOfBisPlane,
myFaces->ChangeArray2() = theFaces->Array2();
}
-// ===========================================================================================
-// function: AddBounds
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
void BRepFill_TrimShellCorner::AddBounds(const Handle(TopTools_HArray2OfShape)& theBounds)
{
myBounds = new TopTools_HArray2OfShape(theBounds->LowerRow(),
myBounds->ChangeArray2() = theBounds->Array2();
}
-// ===========================================================================================
-// function: AddUEdges
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
void BRepFill_TrimShellCorner::AddUEdges(const Handle(TopTools_HArray2OfShape)& theUEdges)
{
myUEdges = new TopTools_HArray2OfShape(theUEdges->LowerRow(),
myUEdges->ChangeArray2() = theUEdges->Array2();
}
-// ===========================================================================================
-// function: AddVEdges
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
void BRepFill_TrimShellCorner::AddVEdges(const Handle(TopTools_HArray2OfShape)& theVEdges,
const Standard_Integer theIndex)
{
myVEdges->SetValue(i, theVEdges->Value(i, theIndex));
}
-// ===========================================================================================
-// function: Perform
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
void BRepFill_TrimShellCorner::Perform()
{
Standard_Integer anIndex1, anIndex2, nF1, nF2, i, j, aNbP, aNbC;
myDone = Standard_True;
}
-// ===========================================================================================
-// function: IsDone
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
Standard_Boolean BRepFill_TrimShellCorner::IsDone() const
{
return myDone;
}
-// ===========================================================================================
-// function: HasSection
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
Standard_Boolean BRepFill_TrimShellCorner::HasSection() const
{
return myHasSection;
}
-// ===========================================================================================
-// function: Modified
-// purpose:
-// ===========================================================================================
+//=================================================================================================
+
void BRepFill_TrimShellCorner::Modified(const TopoDS_Shape& theShape,
TopTools_ListOfShape& theModified)
{
#include <random>
-// =======================================================================
-// function : BRepLib_PointCloudShape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
BRepLib_PointCloudShape::BRepLib_PointCloudShape(const TopoDS_Shape& theShape,
const Standard_Real theTol)
: myShape(theShape),
//
}
-// =======================================================================
-// function : ~BRepLib_PointCloudShape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
BRepLib_PointCloudShape::~BRepLib_PointCloudShape()
{
//
}
-// =======================================================================
-// function : NbPointsByDensity
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer BRepLib_PointCloudShape::NbPointsByDensity(const Standard_Real theDensity)
{
clear();
return aNbPoints;
}
-// =======================================================================
-// function : GeneratePointsByDensity
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByDensity(const Standard_Real theDensity)
{
if (myFacePoints.IsEmpty())
return (aNbAdded > 0);
}
-// =======================================================================
-// function : GeneratePointsByTriangulation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByTriangulation()
{
clear();
return (aNbAdded > 0);
}
-// =======================================================================
-// function : faceArea
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real BRepLib_PointCloudShape::faceArea(const TopoDS_Shape& theShape)
{
Standard_Real anArea = 0.0;
return anArea;
}
-// =======================================================================
-// function : computeDensity
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real BRepLib_PointCloudShape::computeDensity()
{
// at first step find the face with smallest area
return anAreaMin * 0.1;
}
-// =======================================================================
-// function : NbPointsByTriangulation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer BRepLib_PointCloudShape::NbPointsByTriangulation() const
{
// at first step find the face with smallest area
return aNbPoints;
}
-// =======================================================================
-// function : addDensityPoints
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean BRepLib_PointCloudShape::addDensityPoints(const TopoDS_Shape& theFace)
{
// addition of the points with specified density on the face by random way
return Standard_True;
}
-// =======================================================================
-// function : addTriangulationPoints
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean BRepLib_PointCloudShape::addTriangulationPoints(const TopoDS_Shape& theFace)
{
TopLoc_Location aLoc;
return Standard_True;
}
-// =======================================================================
-// function : clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void BRepLib_PointCloudShape::clear()
{
myFaceArea.Clear();
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
-// =======================================================================
-// function : ComputeNormals
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void BRepLib_ToolTriangulatedShape::ComputeNormals(const TopoDS_Face& theFace,
const Handle(Poly_Triangulation)& theTris,
Poly_Connect& thePolyConnect)
}
#ifdef OCCT_DEBUG
- //=======================================================================
- // function : BRepMesh_DumpPoly
- // purpose :
- //=======================================================================
+//=================================================================================================
+
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <Standard_ErrorHandler.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BVH_Properties, Standard_Transient)
-// =======================================================================
-// function : ~BVH_Properties
-// purpose :
-// =======================================================================
+//=================================================================================================
+
BVH_Properties::~BVH_Properties()
{
//
aTool.BuildBox(*this);
}
-// =======================================================================
-// function : IsOut
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Bnd_OBB::IsOut(const Bnd_OBB& theOther) const
{
if (IsVoid() || theOther.IsVoid())
return Standard_False;
}
-// =======================================================================
-// function : IsOut
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Bnd_OBB::IsOut(const gp_Pnt& theP) const
{
// 1. Project the point to myAxes[i] (i=0...2).
return Standard_True;
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Bnd_OBB::Add(const gp_Pnt& theP)
{
if (IsVoid())
}
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Bnd_OBB::Add(const Bnd_OBB& theOther)
{
if (!theOther.IsVoid())
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Bnd_Range::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, Bnd_Range)
IMPLEMENT_STANDARD_RTTIEXT(D3DHost_FrameBuffer, OpenGl_FrameBuffer)
-// =======================================================================
-// function : D3DHost_FrameBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
D3DHost_FrameBuffer::D3DHost_FrameBuffer()
: myD3dSurf(NULL),
myD3dSurfShare(NULL),
//
}
-// =======================================================================
-// function : ~D3DHost_FrameBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
D3DHost_FrameBuffer::~D3DHost_FrameBuffer()
{
Release(NULL);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_FrameBuffer::Release(OpenGl_Context* theCtx)
{
if (myGlD3dDevice != NULL)
OpenGl_FrameBuffer::Release(theCtx);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean D3DHost_FrameBuffer::Init(const Handle(OpenGl_Context)& theCtx,
IDirect3DDevice9* theD3DDevice,
const Standard_Boolean theIsD3dEx,
return InitD3dFallback(theCtx, theD3DDevice, theIsD3dEx, theSizeX, theSizeY, GL_DEPTH24_STENCIL8);
}
-// =======================================================================
-// function : InitD3dFallback
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean D3DHost_FrameBuffer::InitD3dFallback(const Handle(OpenGl_Context)& theCtx,
IDirect3DDevice9* theD3DDevice,
const Standard_Boolean theIsD3dEx,
return isGlInit;
}
-// =======================================================================
-// function : InitD3dInterop
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean D3DHost_FrameBuffer::InitD3dInterop(const Handle(OpenGl_Context)& theCtx,
IDirect3DDevice9* theD3DDevice,
const Standard_Boolean theIsD3dEx,
return Standard_True;
}
-// =======================================================================
-// function : registerD3dBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean D3DHost_FrameBuffer::registerD3dBuffer(const Handle(OpenGl_Context)& theCtx)
{
const OpenGl_GlFunctions* aFuncs = theCtx->Functions();
return Standard_True;
}
-// =======================================================================
-// function : BindBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_FrameBuffer::BindBuffer(const Handle(OpenGl_Context)& theCtx)
{
Standard_ProgramError_Raise_if(
}
}
-// =======================================================================
-// function : LockSurface
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_FrameBuffer::LockSurface(const Handle(OpenGl_Context)& theCtx)
{
if (++myLockCount > 1)
}
}
-// =======================================================================
-// function : UnlockSurface
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_FrameBuffer::UnlockSurface(const Handle(OpenGl_Context)& theCtx)
{
if (--myLockCount != 0)
#pragma comment(lib, "D3D9.lib")
#endif
-// =======================================================================
-// function : D3DHost_GraphicDriver
-// purpose :
-// =======================================================================
+//=================================================================================================
+
D3DHost_GraphicDriver::D3DHost_GraphicDriver()
: OpenGl_GraphicDriver(Handle(Aspect_DisplayConnection)(), Standard_True)
{
//
}
-// =======================================================================
-// function : ~D3DHost_GraphicDriver
-// purpose :
-// =======================================================================
+//=================================================================================================
+
D3DHost_GraphicDriver::~D3DHost_GraphicDriver()
{
//
}
-// =======================================================================
-// function : CreateView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_CView) D3DHost_GraphicDriver::CreateView(
const Handle(Graphic3d_StructureManager)& theMgr)
{
IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriverFactory, OpenGl_GraphicDriverFactory)
-// =======================================================================
-// function : D3DHost_GraphicDriverFactory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
D3DHost_GraphicDriverFactory::D3DHost_GraphicDriverFactory()
{
myName = "TKD3DHost";
}
-// =======================================================================
-// function : CreateDriver
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_GraphicDriver) D3DHost_GraphicDriverFactory::CreateDriver(
const Handle(Aspect_DisplayConnection)&)
{
};
} // namespace
-// =======================================================================
-// function : d3dFormatError
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString D3DHost_View::d3dFormatError(const long theErrCode)
{
switch (theErrCode)
}
}
-// =======================================================================
-// function : D3DHost_View
-// purpose :
-// =======================================================================
+//=================================================================================================
+
D3DHost_View::D3DHost_View(const Handle(Graphic3d_StructureManager)& theMgr,
const Handle(D3DHost_GraphicDriver)& theDriver,
const Handle(OpenGl_Caps)& theCaps,
myD3dParams->PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
}
-// =======================================================================
-// function : ~D3DHost_View
-// purpose :
-// =======================================================================
+//=================================================================================================
+
D3DHost_View::~D3DHost_View()
{
ReleaseGlResources(NULL);
}
}
-// =======================================================================
-// function : ReleaseGlResources
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::ReleaseGlResources(const Handle(OpenGl_Context)& theCtx)
{
if (!myD3dWglFbo.IsNull())
OpenGl_View::ReleaseGlResources(theCtx);
}
-// =======================================================================
-// function : D3dColorSurface
-// purpose :
-// =======================================================================
+//=================================================================================================
+
IDirect3DSurface9* D3DHost_View::D3dColorSurface() const
{
return myD3dWglFbo->D3dColorSurface();
}
-// =======================================================================
-// function : SetWindow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::SetWindow(const Handle(Graphic3d_CView)& theParentVIew,
const Handle(Aspect_Window)& theWindow,
const Aspect_RenderingContext theContext)
}
}
-// =======================================================================
-// function : DiagnosticInformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::DiagnosticInformation(TColStd_IndexedDataMapOfStringString& theDict,
Graphic3d_DiagnosticInfo theFlags) const
{
: "WGL_NV_DX_interop");
}
-// =======================================================================
-// function : d3dInitLib
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool D3DHost_View::d3dInitLib()
{
if (myD3dLib == NULL)
return myD3dLib != NULL;
}
-// =======================================================================
-// function : d3dInit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool D3DHost_View::d3dInit()
{
if (!d3dInitLib())
return myD3dDevice != NULL;
}
-// =======================================================================
-// function : d3dReset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool D3DHost_View::d3dReset()
{
if (myD3dDevice == NULL)
return isOK == D3D_OK;
}
-// =======================================================================
-// function : d3dCreateRenderTarget
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool D3DHost_View::d3dCreateRenderTarget()
{
bool toD3dFallback = false;
return true;
}
-// =======================================================================
-// function : d3dBeginRender
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::d3dBeginRender()
{
if (myD3dDevice == NULL)
myD3dDevice->BeginScene();
}
-// =======================================================================
-// function : d3dEndRender
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::d3dEndRender()
{
if (myD3dDevice != NULL)
}
}
-// =======================================================================
-// function : d3dSwap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool D3DHost_View::d3dSwap()
{
if (myD3dDevice == NULL)
return isOK == D3D_OK;
}
-// =======================================================================
-// function : Redraw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::Redraw()
{
if (!myWorkspace->Activate() || myD3dDevice == NULL)
d3dSwap();
}
-// =======================================================================
-// function : RedrawImmediate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::RedrawImmediate()
{
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
d3dSwap();
}
-// =======================================================================
-// function : Resize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void D3DHost_View::Resized()
{
const Standard_Integer aWidthOld = myWindow->Width();
#include <Draw_PluginMacro.hxx>
#include <D3DHost_GraphicDriverFactory.hxx>
-// ======================================================================
-// function : Factory
-// purpose :
-// ======================================================================
+//=================================================================================================
+
void D3DHostTest::Factory(Draw_Interpretor&)
{
static const Handle(D3DHost_GraphicDriverFactory) aFactory = new D3DHost_GraphicDriverFactory();
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void DsgPrs_DatumPrs::Add(const Handle(Prs3d_Presentation)& thePresentation,
const gp_Ax2& theDatum,
const Handle(Prs3d_Drawer)& theDrawer)
{
}
-// =======================================================================
-// function : ~Extrema_GenExtCS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Extrema_GenExtCS::~Extrema_GenExtCS()
{
//
myAlgo = Extrema_ExtAlgo_Grad;
}
-// =======================================================================
-// function : ~Extrema_GenExtPS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Extrema_GenExtPS::~Extrema_GenExtPS()
{
//
}
-// =======================================================================
-// function : Extrema_GenExtPS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Extrema_GenExtPS::Extrema_GenExtPS(const gp_Pnt& P,
const Adaptor3d_Surface& S,
const Standard_Integer NbU,
myInit = Standard_False;
}
-// =======================================================================
-// function : ~Extrema_GenExtSS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Extrema_GenExtSS::~Extrema_GenExtSS()
{
//
IMPLEMENT_STANDARD_RTTIEXT(Font_FTFont, Standard_Transient)
-// =======================================================================
-// function : Font_FTFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_FTFont::Font_FTFont(const Handle(Font_FTLibrary)& theFTLib)
: myFTLib(theFTLib),
myFTFace(NULL),
}
}
-// =======================================================================
-// function : Font_FTFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_FTFont::~Font_FTFont()
{
Release();
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FTFont::Release()
{
myGlyphImg.Clear();
myBuffer.Nullify();
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FTFont::Init(const Handle(NCollection_Buffer)& theData,
const TCollection_AsciiString& theFileName,
const Font_FTFontParams& theParams,
#endif
}
-// =======================================================================
-// function : FindAndCreate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_FTFont) Font_FTFont::FindAndCreate(const TCollection_AsciiString& theFontName,
const Font_FontAspect theFontAspect,
const Font_FTFontParams& theParams,
return Handle(Font_FTFont)();
}
-// =======================================================================
-// function : FindAndInit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FTFont::FindAndInit(const TCollection_AsciiString& theFontName,
Font_FontAspect theFontAspect,
const Font_FTFontParams& theParams,
return false;
}
-// =======================================================================
-// function : findAndInitFallback
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FTFont::findAndInitFallback(Font_UnicodeSubset theSubset)
{
if (!myFallbackFaces[theSubset].IsNull())
return myFallbackFaces[theSubset]->IsValid();
}
-// =======================================================================
-// function : HasSymbol
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FTFont::HasSymbol(Standard_Utf32Char theUChar) const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : loadGlyph
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FTFont::loadGlyph(const Standard_Utf32Char theUChar)
{
if (myUChar == theUChar)
#endif
}
-// =======================================================================
-// function : RenderGlyph
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FTFont::RenderGlyph(const Standard_Utf32Char theUChar)
{
myGlyphImg.Clear();
#endif
}
-// =======================================================================
-// function : GlyphMaxSizeX
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int Font_FTFont::GlyphMaxSizeX(bool theToIncludeFallback) const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : GlyphMaxSizeY
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int Font_FTFont::GlyphMaxSizeY(bool theToIncludeFallback) const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : Ascender
-// purpose :
-// =======================================================================
+//=================================================================================================
+
float Font_FTFont::Ascender() const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : Descender
-// purpose :
-// =======================================================================
+//=================================================================================================
+
float Font_FTFont::Descender() const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : LineSpacing
-// purpose :
-// =======================================================================
+//=================================================================================================
+
float Font_FTFont::LineSpacing() const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : AdvanceX
-// purpose :
-// =======================================================================
+//=================================================================================================
+
float Font_FTFont::AdvanceX(Standard_Utf32Char theUChar, Standard_Utf32Char theUCharNext)
{
loadGlyph(theUChar);
return AdvanceX(theUCharNext);
}
-// =======================================================================
-// function : AdvanceY
-// purpose :
-// =======================================================================
+//=================================================================================================
+
float Font_FTFont::AdvanceY(Standard_Utf32Char theUChar, Standard_Utf32Char theUCharNext)
{
loadGlyph(theUChar);
return AdvanceY(theUCharNext);
}
-// =======================================================================
-// function : getKerning
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FTFont::getKerning(FT_Vector& theKern,
Standard_Utf32Char theUCharCurr,
Standard_Utf32Char theUCharNext) const
return false;
}
-// =======================================================================
-// function : AdvanceX
-// purpose :
-// =======================================================================
+//=================================================================================================
+
float Font_FTFont::AdvanceX(Standard_Utf32Char theUCharNext) const
{
if (myUChar == 0)
#endif
}
-// =======================================================================
-// function : AdvanceY
-// purpose :
-// =======================================================================
+//=================================================================================================
+
float Font_FTFont::AdvanceY(Standard_Utf32Char theUCharNext) const
{
if (myUChar == 0)
#endif
}
-// =======================================================================
-// function : GlyphsNumber
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Font_FTFont::GlyphsNumber(bool theToIncludeFallback) const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : GlyphRect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FTFont::GlyphRect(Font_Rect& theRect) const
{
#ifdef HAVE_FREETYPE
#endif
}
-// =======================================================================
-// function : BoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_Rect Font_FTFont::BoundingBox(const NCollection_String& theString,
const Graphic3d_HorizontalTextAlignment theAlignX,
const Graphic3d_VerticalTextAlignment theAlignY)
return aBndBox;
}
-// =======================================================================
-// function : renderGlyphOutline
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const FT_Outline* Font_FTFont::renderGlyphOutline(const Standard_Utf32Char theChar)
{
#ifdef HAVE_FREETYPE
IMPLEMENT_STANDARD_RTTIEXT(Font_FTLibrary, Standard_Transient)
-// =======================================================================
-// function : Font_FTLibrary
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_FTLibrary::Font_FTLibrary()
: myFTLib(NULL)
{
#endif
}
-// =======================================================================
-// function : ~Font_FTLibrary
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_FTLibrary::~Font_FTLibrary()
{
if (IsValid())
#endif
}
-// =======================================================================
-// function : GetInstance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_FontMgr) Font_FontMgr::GetInstance()
{
static Handle(Font_FontMgr) _mgr;
return _mgr;
}
-// =======================================================================
-// function : ToUseUnicodeSubsetFallback
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean& Font_FontMgr::ToUseUnicodeSubsetFallback()
{
static Standard_Boolean TheToUseUnicodeSubsetFallback = true;
return TheToUseUnicodeSubsetFallback;
}
-// =======================================================================
-// function : AddFontAlias
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FontMgr::AddFontAlias(const TCollection_AsciiString& theAliasName,
const TCollection_AsciiString& theFontName)
{
return true;
}
-// =======================================================================
-// function : RemoveFontAlias
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Font_FontMgr::RemoveFontAlias(const TCollection_AsciiString& theAliasName,
const TCollection_AsciiString& theFontName)
{
return false;
}
-// =======================================================================
-// function : GetAllAliases
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FontMgr::GetAllAliases(TColStd_SequenceOfHAsciiString& theAliases) const
{
for (NCollection_DataMap<TCollection_AsciiString, Handle(Font_FontAliasSequence)>::Iterator
}
}
-// =======================================================================
-// function : GetFontAliases
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FontMgr::GetFontAliases(TColStd_SequenceOfHAsciiString& theFontNames,
const TCollection_AsciiString& theAliasName) const
{
}
}
-// =======================================================================
-// function : addFontAlias
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FontMgr::addFontAlias(const TCollection_AsciiString& theAliasName,
const Handle(Font_FontAliasSequence)& theAliases,
Font_FontAspect theAspect)
myFontAliases.Bind(anAliasName, anAliases);
}
-// =======================================================================
-// function : Font_FontMgr
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_FontMgr::Font_FontMgr()
: myToTraceAliases(Standard_False)
{
InitFontDataBase();
}
-// =======================================================================
-// function : CheckFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Font_FontMgr::CheckFont(NCollection_Sequence<Handle(Font_SystemFont)>& theFonts,
const TCollection_AsciiString& theFontPath) const
{
return checkFont(theFonts, aFtLibrary, theFontPath, 0);
}
-// =======================================================================
-// function : CheckFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_SystemFont) Font_FontMgr::CheckFont(Standard_CString theFontPath) const
{
Handle(Font_FTLibrary) aFtLibrary = new Font_FTLibrary();
return checkFont(aFonts, aFtLibrary, theFontPath, 0) ? aFonts.First() : Handle(Font_SystemFont)();
}
-// =======================================================================
-// function : RegisterFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Font_FontMgr::RegisterFont(const Handle(Font_SystemFont)& theFont,
const Standard_Boolean theToOverride)
{
return Standard_True;
}
-// =======================================================================
-// function : ClearFontDataBase()
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FontMgr::ClearFontDataBase()
{
myFontMap.Clear();
}
-// =======================================================================
-// function : InitFontDataBase
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FontMgr::InitFontDataBase()
{
myFontMap.Clear();
#endif
}
-// =======================================================================
-// function : GetAvailableFontsNames
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_FontMgr::GetAvailableFontsNames(TColStd_SequenceOfHAsciiString& theFontsNames) const
{
theFontsNames.Clear();
}
}
-// =======================================================================
-// function : GetFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_SystemFont) Font_FontMgr::GetFont(const Handle(TCollection_HAsciiString)& theFontName,
const Font_FontAspect theFontAspect,
const Standard_Integer theFontSize) const
: Handle(Font_SystemFont)();
}
-// =======================================================================
-// function : GetFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_SystemFont) Font_FontMgr::GetFont(const TCollection_AsciiString& theFontName) const
{
return myFontMap.Find(theFontName);
}
-// =======================================================================
-// function : FindFallbackFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_SystemFont) Font_FontMgr::FindFallbackFont(Font_UnicodeSubset theSubset,
Font_FontAspect theFontAspect) const
{
return aFont;
}
-// =======================================================================
-// function : FindFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_SystemFont) Font_FontMgr::FindFont(const TCollection_AsciiString& theFontName,
Font_StrictLevel theStrictLevel,
Font_FontAspect& theFontAspect,
return aFont;
}
-// =======================================================================
-// function : Font_FontMap::Find
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Font_SystemFont) Font_FontMgr::Font_FontMap::Find(
const TCollection_AsciiString& theFontName) const
{
return Handle(Font_SystemFont)();
}
-// =======================================================================
-// function : EmbedFallbackFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(NCollection_Buffer) Font_FontMgr::EmbedFallbackFont()
{
#ifdef HAVE_FREETYPE
IMPLEMENT_STANDARD_RTTIEXT(Font_SystemFont, Standard_Transient)
-// =======================================================================
-// function : Font_SystemFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_SystemFont::Font_SystemFont(const TCollection_AsciiString& theFontName)
: myFontKey(theFontName),
myFontName(theFontName),
myFontKey.LowerCase();
}
-// =======================================================================
-// function : SetFontPath
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_SystemFont::SetFontPath(Font_FontAspect theAspect,
const TCollection_AsciiString& thePath,
const Standard_Integer theFaceId)
myFaceIds[theAspect] = theFaceId;
}
-// =======================================================================
-// function : IsEqual
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Font_SystemFont::IsEqual(const Handle(Font_SystemFont)& theOtherFont) const
{
return theOtherFont.get() == this || myFontKey.IsEqual(theOtherFont->myFontKey);
}
-// =======================================================================
-// function : ToString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Font_SystemFont::ToString() const
{
TCollection_AsciiString aDesc;
} // namespace
-// =======================================================================
-// function : Font_TextFormatter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Font_TextFormatter::Font_TextFormatter()
: myAlignX(Graphic3d_HTA_LEFT),
myAlignY(Graphic3d_VTA_TOP),
//
}
-// =======================================================================
-// function : SetupAlignment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_TextFormatter::SetupAlignment(const Graphic3d_HorizontalTextAlignment theAlignX,
const Graphic3d_VerticalTextAlignment theAlignY)
{
myAlignY = theAlignY;
}
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_TextFormatter::Reset()
{
myIsFormatted = false;
myMaxSymbolWidth = 0.0f;
}
-// =======================================================================
-// function : Append
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_TextFormatter::Append(const NCollection_String& theString, Font_FTFont& theFont)
{
if (theString.IsEmpty())
myLastSymbolWidth = myPen.x() - myCorners.Last().x();
}
-// =======================================================================
-// function : newLine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_TextFormatter::newLine(const Standard_Integer theLastRect,
const Standard_ShortReal theMaxLineWidth)
{
myRectLineStart = theLastRect + 1;
}
-// =======================================================================
-// function : Format
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Font_TextFormatter::Format()
{
if (myCorners.Length() == 0 || myIsFormatted)
}
}
-// =======================================================================
-// function : GlyphBoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Font_TextFormatter::GlyphBoundingBox(const Standard_Integer theIndex,
Font_Rect& theBndBox) const
{
return Standard_True;
}
-// =======================================================================
-// function : IsLFSymbol
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Font_TextFormatter::IsLFSymbol(const Standard_Integer theIndex) const
{
Font_Rect aBndBox;
return Abs(aBndBox.Right - aBndBox.Left) < Precision::Confusion();
}
-// =======================================================================
-// function : FirstPosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal Font_TextFormatter::FirstPosition() const
{
switch (myAlignX)
}
}
-// =======================================================================
-// function : LinePositionIndex
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Font_TextFormatter::LinePositionIndex(const Standard_Integer theIndex) const
{
Standard_Integer anIndex = 0;
return anIndex;
}
-// =======================================================================
-// function : LineIndex
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Font_TextFormatter::LineIndex(const Standard_Integer theIndex) const
{
if (myLineSpacing < 0.0f)
return (Standard_Integer)Abs((BottomLeft(theIndex).y() + myAscender) / myLineSpacing);
}
-// =======================================================================
-// function : LineWidth
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal Font_TextFormatter::LineWidth(const Standard_Integer theIndex) const
{
if (theIndex < 0)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPrimitives)
-// =======================================================================
-// function : CreateArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfPrimitives) Graphic3d_ArrayOfPrimitives::CreateArray(
Graphic3d_TypeOfPrimitiveArray theType,
Standard_Integer theMaxVertexs,
return Handle(Graphic3d_ArrayOfPrimitives)();
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ArrayOfPrimitives::init(Graphic3d_TypeOfPrimitiveArray theType,
Standard_Integer theMaxVertexs,
Standard_Integer theMaxBounds,
}
}
-// =======================================================================
-// function : ~Graphic3d_ArrayOfPrimitives
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ArrayOfPrimitives::~Graphic3d_ArrayOfPrimitives()
{
myIndices.Nullify();
myBounds.Nullify();
}
-// =======================================================================
-// function : AddBound
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(const Standard_Integer theEdgeNumber)
{
Standard_OutOfRange_Raise_if(myBounds.IsNull() || myBounds->NbBounds >= myBounds->NbMaxBounds,
return ++myBounds->NbBounds;
}
-// =======================================================================
-// function : AddBound
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(const Standard_Integer theEdgeNumber,
const Standard_Real theR,
const Standard_Real theG,
return myBounds->NbBounds;
}
-// =======================================================================
-// function : AddEdge
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(const Standard_Integer theVertexIndex)
{
Standard_OutOfRange_Raise_if(myIndices.IsNull()
return ++myIndices->NbElements;
}
-// =======================================================================
-// function : AddTriangleStripEdges
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ArrayOfPrimitives::AddTriangleStripEdges(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper)
{
}
}
-// =======================================================================
-// function : AddTriangleFanEdges
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ArrayOfPrimitives::AddTriangleFanEdges(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper,
Standard_Boolean theToClose)
}
}
-// =======================================================================
-// function : AddPolylineEdges
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ArrayOfPrimitives::AddPolylineEdges(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper,
Standard_Boolean theToClose)
}
}
-// =======================================================================
-// function : StringType
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
{
switch (myType)
return "UndefinedArray";
}
-// =======================================================================
-// function : ItemNumber
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
{
if (myAttribs.IsNull())
return -1;
}
-// =======================================================================
-// function : IsValid
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid()
{
if (myAttribs.IsNull())
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectFillArea3d, Graphic3d_Aspects)
-// =======================================================================
-// function : Graphic3d_AspectFillArea3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d()
{
myInteriorStyle = Aspect_IS_EMPTY;
}
-// =======================================================================
-// function : Graphic3d_AspectFillArea3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d(
const Aspect_InteriorStyle theInteriorStyle,
const Quantity_Color& theInteriorColor,
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectLine3d, Graphic3d_Aspects)
-// =======================================================================
-// function : Graphic3d_AspectLine3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d()
{
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
myLineWidth = 1.0f;
}
-// =======================================================================
-// function : Graphic3d_AspectLine3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d(const Quantity_Color& theColor,
Aspect_TypeOfLine theType,
Standard_Real theWidth)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
-// =======================================================================
-// function : Graphic3d_AspectMarker3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
{
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
myMarkerScale = 1.0f;
}
-// =======================================================================
-// function : Graphic3d_AspectMarker3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType,
const Quantity_Color& theColor,
const Standard_Real theScale)
SetMarkerScale((float)theScale);
}
-// =======================================================================
-// function : Graphic3d_AspectMarker3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(
const Quantity_Color& theColor,
const Standard_Integer theWidth,
myMarkerScale = 1.0f;
}
-// =======================================================================
-// function : Graphic3d_AspectMarker3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d(const Handle(Image_PixMap)& theTextureImage)
{
myShadingModel = Graphic3d_TypeOfShadingModel_Unlit;
myMarkerScale = 1.0f;
}
-// =======================================================================
-// function : GetTextureSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AspectMarker3d::GetTextureSize(Standard_Integer& theWidth,
Standard_Integer& theHeight) const
{
}
}
-// =======================================================================
-// function : SetBitMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AspectMarker3d::SetBitMap(const Standard_Integer theWidth,
const Standard_Integer theHeight,
const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectText3d, Graphic3d_Aspects)
-// =======================================================================
-// function : Graphic3d_AspectText3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectText3d::Graphic3d_AspectText3d()
{
SetAlphaMode(Graphic3d_AlphaMode_MaskBlend, 0.285f);
myEdgeColor.SetRGB(Quantity_NOC_WHITE);
}
-// =======================================================================
-// function : Graphic3d_AspectText3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AspectText3d::Graphic3d_AspectText3d(const Quantity_Color& theColor,
Standard_CString theFont,
Standard_Real,
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AspectText3d::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Aspects, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_Aspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Aspects::Graphic3d_Aspects()
: myInteriorColor(Quantity_NOC_CYAN1),
myBackInteriorColor(Quantity_NOC_CYAN1),
//
}
-// =======================================================================
-// function : SetTextureMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Aspects::SetTextureMap(const Handle(Graphic3d_TextureMap)& theTexture)
{
if (theTexture.IsNull())
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AttribBuffer, Graphic3d_Buffer)
-// =======================================================================
-// function : Graphic3d_AttribBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_AttribBuffer::Graphic3d_AttribBuffer(const Handle(NCollection_BaseAllocator)& theAlloc)
: Graphic3d_Buffer(theAlloc),
myIsInterleaved(Standard_True),
{
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_AttribBuffer::Init(const Standard_Integer theNbElems,
const Graphic3d_Attribute* theAttribs,
const Standard_Integer theNbAttribs)
return true;
}
-// =======================================================================
-// function : SetMutable
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AttribBuffer::SetMutable(Standard_Boolean theMutable)
{
if (mySize > (Standard_Size)IntegerLast() && theMutable)
myIsMutable = theMutable;
}
-// =======================================================================
-// function : Invalidate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AttribBuffer::SetInterleaved(Standard_Boolean theIsInterleaved)
{
if (NbMaxElements() != 0)
myIsInterleaved = theIsInterleaved;
}
-// =======================================================================
-// function : invalidate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AttribBuffer::invalidate(const Graphic3d_BufferRange& theRange)
{
if (mySize > (Standard_Size)IntegerLast())
myInvalidatedRange.Unite(theRange);
}
-// =======================================================================
-// function : Invalidate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AttribBuffer::Invalidate()
{
if (mySize > (Standard_Size)IntegerLast())
invalidate(Graphic3d_BufferRange(0, (Standard_Integer)mySize));
}
-// =======================================================================
-// function : Invalidate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theAttributeIndex)
{
Standard_OutOfRange_Raise_if(theAttributeIndex < 0 || theAttributeIndex >= NbAttributes,
}
}
-// =======================================================================
-// function : Invalidate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theAttributeIndex,
Standard_Integer theVertexLower,
Standard_Integer theVertexUpper)
}
}
-// =======================================================================
-// function : Invalidate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_AttribBuffer::Invalidate(Standard_Integer theVertexLower,
Standard_Integer theVertexUpper)
{
#include <algorithm>
-// =======================================================================
-// function : Serialize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec4 Graphic3d_Fresnel::Serialize() const
{
Graphic3d_Vec4 aData = Graphic3d_Vec4(myFresnelData, 0.f);
return aData;
}
-// =======================================================================
-// function : fresnelNormal
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline float fresnelNormal(float theN, float theK)
{
return ((theN - 1.f) * (theN - 1.f) + theK * theK) / ((theN + 1.f) * (theN + 1.f) + theK * theK);
}
-// =======================================================================
-// function : CreateConductor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Fresnel Graphic3d_Fresnel::CreateConductor(const Graphic3d_Vec3& theRefractionIndex,
const Graphic3d_Vec3& theAbsorptionIndex)
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myFresnelType)
OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &myFresnelData)}
-// =======================================================================
-// function : Graphic3d_BSDF
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BSDF::Graphic3d_BSDF()
: Ks(Graphic3d_Vec3(0.f), 1.f)
{
&& FresnelCoat == theOther.FresnelCoat && FresnelBase == theOther.FresnelBase;
}
-// =======================================================================
-// function : Normalize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_BSDF::Normalize()
{
float aMax = 0.f;
}
}
-// =======================================================================
-// function : CreateDiffuse
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BSDF Graphic3d_BSDF::CreateDiffuse(const Graphic3d_Vec3& theWeight)
{
Graphic3d_BSDF aBSDF;
return aBSDF;
}
-// =======================================================================
-// function : CreateMetallic
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BSDF Graphic3d_BSDF::CreateMetallic(const Graphic3d_Vec3& theWeight,
const Graphic3d_Fresnel& theFresnel,
const float theRoughness)
return aBSDF;
}
-// =======================================================================
-// function : CreateTransparent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BSDF Graphic3d_BSDF::CreateTransparent(const Graphic3d_Vec3& theWeight,
const Graphic3d_Vec3& theAbsorptionColor,
const float theAbsorptionCoeff)
return aBSDF;
}
-// =======================================================================
-// function : CreateGlass
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BSDF Graphic3d_BSDF::CreateGlass(const Graphic3d_Vec3& theWeight,
const Graphic3d_Vec3& theAbsorptionColor,
const float theAbsorptionCoeff,
return aBSDF;
}
-// =======================================================================
-// function : CreateMetallicRoughness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BSDF Graphic3d_BSDF::CreateMetallicRoughness(const Graphic3d_PBRMaterial& thePbr)
{
const Graphic3d_Vec3 aDiff = (Graphic3d_Vec3)thePbr.Color().GetRGB() * thePbr.Alpha();
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_BoundBuffer, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MutableIndexBuffer, Graphic3d_IndexBuffer)
-// =======================================================================
-// function : DefaultAllocator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(NCollection_BaseAllocator)& Graphic3d_Buffer::DefaultAllocator()
{
static const Handle(NCollection_BaseAllocator) THE_ALLOC = new NCollection_AlignedAllocator(16);
return THE_ALLOC;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Buffer::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_BvhCStructureSet, BVH_PrimitiveSet3d)
-// =======================================================================
-// function : Graphic3d_BvhCStructureSet
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BvhCStructureSet::Graphic3d_BvhCStructureSet()
{
myBuilder = new BVH_BinnedBuilder<Standard_Real, 3>(BVH_Constants_LeafNodeSizeSingle,
BVH_Constants_MaxTreeDepth);
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_BvhCStructureSet::Size() const
{
return myStructs.Size();
}
-// =======================================================================
-// function : Box
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BndBox3d Graphic3d_BvhCStructureSet::Box(const Standard_Integer theIdx) const
{
return myStructs.FindKey(theIdx + 1)->BoundingBox();
}
-// =======================================================================
-// function : Center
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Graphic3d_BvhCStructureSet::Center(const Standard_Integer theIdx,
const Standard_Integer theAxis) const
{
return aCenter;
}
-// =======================================================================
-// function : Swap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_BvhCStructureSet::Swap(const Standard_Integer theIdx1,
const Standard_Integer theIdx2)
{
myStructs.Swap(theIdx1 + 1, theIdx2 + 1);
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_BvhCStructureSet::Add(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer aSize = myStructs.Size();
return Standard_False;
}
-// =======================================================================
-// function : Remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_BvhCStructureSet::Remove(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer anIndex = myStructs.FindIndex(theStruct);
return Standard_False;
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_BvhCStructureSet::Clear()
{
myStructs.Clear();
MarkDirty();
}
-// =======================================================================
-// function : GetStructureById
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_CStructure* Graphic3d_BvhCStructureSet::GetStructureById(Standard_Integer theId)
{
return myStructs.FindKey(theId + 1);
#include <Graphic3d_CStructure.hxx>
-// =======================================================================
-// function : Graphic3d_BvhCStructureSetTrsfPers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BvhCStructureSetTrsfPers::Graphic3d_BvhCStructureSetTrsfPers(
const Handle(BVH_Builder3d)& theBuilder)
: myIsDirty(Standard_False),
//
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_BvhCStructureSetTrsfPers::Size() const
{
return myStructs.Size();
}
-// =======================================================================
-// function : Box
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_BndBox3d Graphic3d_BvhCStructureSetTrsfPers::Box(const Standard_Integer theIdx) const
{
return *myStructBoxes(theIdx + 1);
}
-// =======================================================================
-// function : Center
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Graphic3d_BvhCStructureSetTrsfPers::Center(const Standard_Integer theIdx,
const Standard_Integer theAxis) const
{
return (aBndBox.CornerMin()[theAxis] + aBndBox.CornerMax()[theAxis]) * 0.5;
}
-// =======================================================================
-// function : Swap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_BvhCStructureSetTrsfPers::Swap(const Standard_Integer theIdx1,
const Standard_Integer theIdx2)
{
myStructBoxes.Swap(aStructIdx1, aStructIdx2);
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_BvhCStructureSetTrsfPers::Add(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer aSize = myStructs.Size();
return Standard_False;
}
-// =======================================================================
-// function : Remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_BvhCStructureSetTrsfPers::Remove(const Graphic3d_CStructure* theStruct)
{
const Standard_Integer anIndex = myStructs.FindIndex(theStruct);
return Standard_False;
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_BvhCStructureSetTrsfPers::Clear()
{
myStructs.Clear();
MarkDirty();
}
-// =======================================================================
-// function : GetStructureById
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_CStructure* Graphic3d_BvhCStructureSetTrsfPers::GetStructureById(
Standard_Integer theId)
{
static volatile Standard_Integer THE_LIGHT_COUNTER = 0;
}
-// =======================================================================
-// function : makeId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::makeId()
{
TCollection_AsciiString aTypeSuffix;
+ TCollection_AsciiString(Standard_Atomic_Increment(&THE_LIGHT_COUNTER));
}
-// =======================================================================
-// function : Graphic3d_CLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CLight::Graphic3d_CLight(Graphic3d_TypeOfLightSource theType)
: myPosition(0.0, 0.0, 0.0),
myColor(1.0f, 1.0f, 1.0f, 1.0f),
makeId();
}
-// =======================================================================
-// function : CopyFrom
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::CopyFrom(const Handle(Graphic3d_CLight)& theLight)
{
myName = theLight->myName;
}
}
-// =======================================================================
-// function : SetColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetColor(const Quantity_Color& theColor)
{
updateRevisionIf(myColor.GetRGB().IsDifferent(theColor));
myColor.SetRGB(theColor);
}
-// =======================================================================
-// function : SetEnabled
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetEnabled(Standard_Boolean theIsOn)
{
updateRevisionIf(myIsEnabled != theIsOn);
myIsEnabled = theIsOn;
}
-// =======================================================================
-// function : SetCastShadows
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetCastShadows(Standard_Boolean theToCast)
{
if (myType != Graphic3d_TypeOfLightSource_Directional
myToCastShadows = theToCast;
}
-// =======================================================================
-// function : SetHeadlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetHeadlight(Standard_Boolean theValue)
{
if (myType == Graphic3d_TypeOfLightSource_Ambient)
myIsHeadlight = theValue;
}
-// =======================================================================
-// function : SetDirection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetDirection(const gp_Dir& theDir)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot
myDirection.z() = static_cast<Standard_ShortReal>(theDir.Z());
}
-// =======================================================================
-// function : SetPosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetPosition(const gp_Pnt& thePosition)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot
myPosition = thePosition;
}
-// =======================================================================
-// function : SetDisplayPosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetDisplayPosition(const gp_Pnt& thePosition)
{
Standard_ProgramError_Raise_if(myType == Graphic3d_TypeOfLightSource_Ambient,
myPosition = thePosition;
}
-// =======================================================================
-// function : SetIntensity
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetIntensity(Standard_ShortReal theValue)
{
Standard_OutOfRange_Raise_if(theValue <= 0.0f,
myIntensity = theValue;
}
-// =======================================================================
-// function : SetAngle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetAngle(Standard_ShortReal theAngle)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot,
changeAngle() = theAngle;
}
-// =======================================================================
-// function : SetAttenuation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetAttenuation(Standard_ShortReal theConstAttenuation,
Standard_ShortReal theLinearAttenuation)
{
changeLinearAttenuation() = theLinearAttenuation;
}
-// =======================================================================
-// function : SetConcentration
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetConcentration(Standard_ShortReal theConcentration)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Spot,
changeConcentration() = theConcentration;
}
-// =======================================================================
-// function : SetSmoothRadius
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetSmoothRadius(Standard_ShortReal theValue)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Positional
mySmoothness = theValue;
}
-// =======================================================================
-// function : SetSmoothAngle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetSmoothAngle(Standard_ShortReal theValue)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Directional,
mySmoothness = theValue;
}
-// =======================================================================
-// function : SetRange
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CLight::SetRange(Standard_ShortReal theValue)
{
Standard_ProgramError_Raise_if(myType != Graphic3d_TypeOfLightSource_Positional
}
}
-// =======================================================================
-// function : SetBackgroundSkydome
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::SetBackgroundSkydome(const Aspect_SkydomeBackground& theAspect,
Standard_Boolean theToUpdatePBREnv)
{
}
}
-// =======================================================================
-// function : Activate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Activate()
{
if (!IsActive())
Update();
}
-// =======================================================================
-// function : Deactivate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Deactivate()
{
if (IsActive())
}
}
-// ========================================================================
-// function : Remove
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_CView::Remove()
{
if (IsRemoved())
myIsRemoved = Standard_True;
}
-// ========================================================================
-// function : AddSubview
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_CView::AddSubview(const Handle(Graphic3d_CView)& theView)
{
mySubviews.Append(theView);
}
-// ========================================================================
-// function : RemoveSubview
-// purpose :
-// ========================================================================
+//=================================================================================================
+
bool Graphic3d_CView::RemoveSubview(const Graphic3d_CView* theView)
{
for (NCollection_Sequence<Handle(Graphic3d_CView)>::Iterator aViewIter(mySubviews);
return false;
}
-// ========================================================================
-// function : Resized
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_CView::Resized()
{
if (IsSubview())
}
}
-// ========================================================================
-// function : SubviewResized
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_CView::SubviewResized(const Handle(Aspect_NeutralWindow)& theWindow)
{
if (!IsSubview() || theWindow.IsNull())
theWindow->SetSize(aViewSize.x(), aViewSize.y());
}
-// ========================================================================
-// function : SetComputedMode
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_CView::SetComputedMode(const Standard_Boolean theMode)
{
if ((theMode && myIsInComputedMode) || (!theMode && !myIsInComputedMode))
Update();
}
-// =======================================================================
-// function : ReCompute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::ReCompute(const Handle(Graphic3d_Structure)& theStruct)
{
theStruct->CalculateBoundBox();
myStructsComputed.Remove(anIndex);
}
-// =======================================================================
-// function : Update
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Update(const Graphic3d_ZLayerId theLayerId)
{
InvalidateZLayerBoundingBox(theLayerId);
}
-// =======================================================================
-// function : InvalidateZLayerBoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::InvalidateZLayerBoundingBox(const Graphic3d_ZLayerId theLayerId)
{
if (Handle(Graphic3d_Layer) aLayer = Layer(theLayerId))
}
}
-// =======================================================================
-// function : DisplayedStructures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::DisplayedStructures(Graphic3d_MapOfStructure& theStructures) const
{
for (Graphic3d_MapOfStructure::Iterator aStructIter(myStructsDisplayed); aStructIter.More();
}
}
-// =======================================================================
-// function : MinMaxValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Bnd_Box Graphic3d_CView::MinMaxValues(const Standard_Boolean theToIncludeAuxiliary) const
{
if (!IsDefined())
return aResult;
}
-// =======================================================================
-// function : ConsiderZoomPersistenceObjects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Graphic3d_CView::ConsiderZoomPersistenceObjects()
{
if (!IsDefined())
return aMaxCoef;
}
-// =======================================================================
-// function : MinMaxValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Bnd_Box Graphic3d_CView::MinMaxValues(const Graphic3d_MapOfStructure& theSet,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
return aResult;
}
-// =======================================================================
-// function : acceptDisplay
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TypeOfAnswer Graphic3d_CView::acceptDisplay(
const Graphic3d_TypeOfStructure theStructType) const
{
return Graphic3d_TOA_NO;
}
-// =======================================================================
-// function : Compute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Compute()
{
// force HLRValidation to False on all structures calculated in the view
}
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Clear(Graphic3d_Structure* theStructure,
const Standard_Boolean theWithDestruction)
{
}
}
-// =======================================================================
-// function : Connect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Connect(const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter)
{
}
}
-// =======================================================================
-// function : Disconnect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Disconnect(const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter)
{
}
}
-// =======================================================================
-// function : Display
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Display(const Handle(Graphic3d_Structure)& theStructure)
{
if (!IsActive())
Update(aStruct->GetZLayer());
}
-// =======================================================================
-// function : Erase
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Erase(const Handle(Graphic3d_Structure)& theStructure)
{
if (!IsDisplayed(theStructure))
Update(theStructure->GetZLayer());
}
-// =======================================================================
-// function : Highlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::Highlight(const Handle(Graphic3d_Structure)& theStructure)
{
const Standard_Integer anIndex = IsComputed(theStructure);
}
}
-// =======================================================================
-// function : SetTransform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::SetTransform(const Handle(Graphic3d_Structure)& theStructure,
const Handle(TopLoc_Datum3D)& theTrsf)
{
}
}
-// =======================================================================
-// function : UnHighlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::UnHighlight(const Handle(Graphic3d_Structure)& theStructure)
{
Standard_Integer anIndex = IsComputed(theStructure);
}
}
-// ========================================================================
-// function : IsComputed
-// purpose :
-// ========================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_CView::IsComputed(const Standard_Integer theStructId,
Handle(Graphic3d_Structure)& theComputedStruct) const
{
return Standard_False;
}
-// =======================================================================
-// function : IsComputed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_CView::IsComputed(const Graphic3d_Structure* theStructure) const
{
const Standard_Integer aStructId = theStructure->Identification();
return 0;
}
-// =======================================================================
-// function : IsDisplayed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_CView::IsDisplayed(const Handle(Graphic3d_Structure)& theStructure) const
{
return myStructsDisplayed.Contains(theStructure);
}
-// =======================================================================
-// function : ChangePriority
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::ChangePriority(const Handle(Graphic3d_Structure)& theStructure,
const Graphic3d_DisplayPriority /*theOldPriority*/,
const Graphic3d_DisplayPriority theNewPriority)
changePriority(aCStruct, theNewPriority);
}
-// =======================================================================
-// function : ChangeZLayer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::ChangeZLayer(const Handle(Graphic3d_Structure)& theStructure,
const Graphic3d_ZLayerId theLayerId)
{
changeZLayer(aCStruct, theLayerId);
}
-// =======================================================================
-// function : HaveTheSameOwner
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_CView::HaveTheSameOwner(
const Handle(Graphic3d_Structure)& theStructure) const
{
return 0;
}
-// =======================================================================
-// function : CopySettings
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::CopySettings(const Handle(Graphic3d_CView)& theOther)
{
ChangeRenderingParams() = theOther->RenderingParams();
SetClipPlanes(theOther->ClipPlanes());
}
-// =======================================================================
-// function : SetShadingModel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::SetShadingModel(Graphic3d_TypeOfShadingModel theModel)
{
if (theModel == Graphic3d_TypeOfShadingModel_DEFAULT)
myRenderParams.ShadingModel = theModel;
}
-// =======================================================================
-// function : SetUnitFactor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::SetUnitFactor(Standard_Real theFactor)
{
if (theFactor <= 0.0)
}
}
-// =======================================================================
-// function : IsActiveXR
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_CView::IsActiveXR() const
{
return !myXRSession.IsNull() && myXRSession->IsOpen();
}
-// =======================================================================
-// function : InitXR
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_CView::InitXR()
{
if (myXRSession.IsNull())
return myXRSession->IsOpen();
}
-// =======================================================================
-// function : ReleaseXR
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CView::ReleaseXR()
{
if (!myXRSession.IsNull())
}
} // namespace
-// =======================================================================
-// function : Graphic3d_Camera
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Camera::Graphic3d_Camera()
: myUp(0.0, 1.0, 0.0),
myDirection(0.0, 0.0, 1.0),
this);
}
-// =======================================================================
-// function : Graphic3d_Camera
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Camera::Graphic3d_Camera(const Handle(Graphic3d_Camera)& theOther)
: myUp(0.0, 1.0, 0.0),
myDirection(0.0, 0.0, 1.0),
Copy(theOther);
}
-// =======================================================================
-// function : CopyMappingData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::CopyMappingData(const Handle(Graphic3d_Camera)& theOtherCamera)
{
SetZeroToOneDepth(theOtherCamera->IsZeroToOneDepth());
}
}
-// =======================================================================
-// function : CopyOrientationData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::CopyOrientationData(const Handle(Graphic3d_Camera)& theOtherCamera)
{
if (!myEye.IsEqual(theOtherCamera->Eye(), 0.0) || !myUp.IsEqual(theOtherCamera->Up(), 0.0)
SetAxialScale(theOtherCamera->AxialScale());
}
-// =======================================================================
-// function : Copy
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::Copy(const Handle(Graphic3d_Camera)& theOther)
{
CopyMappingData(theOther);
CopyOrientationData(theOther);
}
-// =======================================================================
-// function : SetIdentityOrientation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetIdentityOrientation()
{
SetEyeAndCenter(gp_Pnt(0.0, 0.0, 0.0), gp_Pnt(0.0, 0.0, -1.0));
SetUp(gp_Dir(0.0, 1.0, 0.0));
}
-// =======================================================================
-// function : MoveEyeTo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::MoveEyeTo(const gp_Pnt& theEye)
{
if (myEye.IsEqual(theEye, 0.0))
InvalidateOrientation();
}
-// =======================================================================
-// function : SetEyeAndCenter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetEyeAndCenter(const gp_Pnt& theEye, const gp_Pnt& theCenter)
{
if (Eye().IsEqual(theEye, 0.0) && Center().IsEqual(theCenter, 0.0))
InvalidateOrientation();
}
-// =======================================================================
-// function : SetEye
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetEye(const gp_Pnt& theEye)
{
if (Eye().IsEqual(theEye, 0.0))
InvalidateOrientation();
}
-// =======================================================================
-// function : SetCenter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetCenter(const gp_Pnt& theCenter)
{
const Standard_Real aDistance = myEye.Distance(theCenter);
InvalidateOrientation();
}
-// =======================================================================
-// function : SetUp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetUp(const gp_Dir& theUp)
{
if (Up().IsEqual(theUp, 0.0))
InvalidateOrientation();
}
-// =======================================================================
-// function : SetAxialScale
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetAxialScale(const gp_XYZ& theAxialScale)
{
Standard_OutOfRange_Raise_if(theAxialScale.X() <= 0.0 || theAxialScale.Y() <= 0.0
InvalidateOrientation();
}
-// =======================================================================
-// function : SetDistance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetDistance(const Standard_Real theDistance)
{
if (myDistance == theDistance)
InvalidateOrientation();
}
-// =======================================================================
-// function : SetDirectionFromEye
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetDirectionFromEye(const gp_Dir& theDir)
{
if (myDirection.IsEqual(theDir, 0.0))
InvalidateOrientation();
}
-// =======================================================================
-// function : SetDirection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetDirection(const gp_Dir& theDir)
{
if (myDirection.IsEqual(theDir, 0.0))
InvalidateOrientation();
}
-// =======================================================================
-// function : SetScale
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetScale(const Standard_Real theScale)
{
if (Scale() == theScale)
InvalidateProjection();
}
-// =======================================================================
-// function : Scale
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Graphic3d_Camera::Scale() const
{
switch (myProjType)
}
}
-// =======================================================================
-// function : SetProjectionType
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetProjectionType(const Projection theProjectionType)
{
Projection anOldType = ProjectionType();
InvalidateProjection();
}
-// =======================================================================
-// function : SetFOVy
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetFOVy(const Standard_Real theFOVy)
{
if (FOVy() == theFOVy)
InvalidateProjection();
}
-// =======================================================================
-// function : SetFOV2d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetFOV2d(const Standard_Real theFOV)
{
if (FOV2d() == theFOV)
InvalidateProjection();
}
-// =======================================================================
-// function : SetZRange
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetZRange(const Standard_Real theZNear, const Standard_Real theZFar)
{
Standard_ASSERT_RAISE(theZFar > theZNear, "ZFar should be greater than ZNear");
InvalidateProjection();
}
-// =======================================================================
-// function : SetAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetAspect(const Standard_Real theAspect)
{
if (Aspect() == theAspect)
InvalidateProjection();
}
-// =======================================================================
-// function : SetZFocus
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetZFocus(const FocusType theType, const Standard_Real theZFocus)
{
if (ZFocusType() == theType && ZFocus() == theZFocus)
InvalidateProjection();
}
-// =======================================================================
-// function : SetIOD
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetIOD(const IODType theType, const Standard_Real theIOD)
{
if (GetIODType() == theType && IOD() == theIOD)
InvalidateProjection();
}
-// =======================================================================
-// function : SetTile
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetTile(const Graphic3d_CameraTile& theTile)
{
if (myTile == theTile)
InvalidateProjection();
}
-// =======================================================================
-// function : OrthogonalizeUp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::OrthogonalizeUp()
{
SetUp(OrthogonalizedUp());
}
-// =======================================================================
-// function : OrthogonalizedUp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Dir Graphic3d_Camera::OrthogonalizedUp() const
{
gp_Dir aDir = Direction();
return aLeft.Crossed(aDir);
}
-// =======================================================================
-// function : Transform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::Transform(const gp_Trsf& theTrsf)
{
if (theTrsf.Form() == gp_Identity)
InvalidateOrientation();
}
-// =======================================================================
-// function : safePointCast
-// purpose :
-// =======================================================================
+//=================================================================================================
+
static Graphic3d_Vec4d safePointCast(const gp_Pnt& thePnt)
{
Standard_Real aLim = 1e15f;
return aPnt;
}
-// =======================================================================
-// function : Project
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt Graphic3d_Camera::Project(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
-// =======================================================================
-// function : UnProject
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt Graphic3d_Camera::UnProject(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
-// =======================================================================
-// function : ConvertView2Proj
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt Graphic3d_Camera::ConvertView2Proj(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aProjMx = ProjectionMatrix();
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
-// =======================================================================
-// function : ConvertProj2View
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt Graphic3d_Camera::ConvertProj2View(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aProjMx = ProjectionMatrix();
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
-// =======================================================================
-// function : ConvertWorld2View
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt Graphic3d_Camera::ConvertWorld2View(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
-// =======================================================================
-// function : ConvertView2World
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt Graphic3d_Camera::ConvertView2World(const gp_Pnt& thePnt) const
{
const Graphic3d_Mat4d& aViewMx = OrientationMatrix();
return gp_Pnt(aPnt.x() * aInvW, aPnt.y() * aInvW, aPnt.z() * aInvW);
}
-// =======================================================================
-// function : ViewDimensions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_XYZ Graphic3d_Camera::ViewDimensions(const Standard_Real theZValue) const
{
// view plane dimensions
return gp_XYZ(aSizeX, aSizeY, myZFar - myZNear);
}
-// =======================================================================
-// function : Frustum
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::Frustum(gp_Pln& theLeft,
gp_Pln& theRight,
gp_Pln& theBottom,
theTop = gp_Pln(aPntTop, aDirTop);
}
-// =======================================================================
-// function : OrientationMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4d& Graphic3d_Camera::OrientationMatrix() const
{
return UpdateOrientation(myMatricesD).Orientation;
}
-// =======================================================================
-// function : OrientationMatrixF
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4& Graphic3d_Camera::OrientationMatrixF() const
{
return UpdateOrientation(myMatricesF).Orientation;
}
-// =======================================================================
-// function : ProjectionMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4d& Graphic3d_Camera::ProjectionMatrix() const
{
return UpdateProjection(myMatricesD).MProjection;
}
-// =======================================================================
-// function : ProjectionMatrixF
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4& Graphic3d_Camera::ProjectionMatrixF() const
{
return UpdateProjection(myMatricesF).MProjection;
}
-// =======================================================================
-// function : ProjectionStereoLeft
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4d& Graphic3d_Camera::ProjectionStereoLeft() const
{
return UpdateProjection(myMatricesD).LProjection;
}
-// =======================================================================
-// function : ProjectionStereoLeftF
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4& Graphic3d_Camera::ProjectionStereoLeftF() const
{
return UpdateProjection(myMatricesF).LProjection;
}
-// =======================================================================
-// function : ProjectionStereoRight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4d& Graphic3d_Camera::ProjectionStereoRight() const
{
return UpdateProjection(myMatricesD).RProjection;
}
-// =======================================================================
-// function : ProjectionStereoRightF
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_Mat4& Graphic3d_Camera::ProjectionStereoRightF() const
{
return UpdateProjection(myMatricesF).RProjection;
}
-// =======================================================================
-// function : ResetCustomProjection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::ResetCustomProjection()
{
if (myIsCustomFrustomLR || myIsCustomProjMatLR || myIsCustomProjMatM)
}
}
-// =======================================================================
-// function : StereoProjection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::StereoProjection(Graphic3d_Mat4d& theProjL,
Graphic3d_Mat4d& theHeadToEyeL,
Graphic3d_Mat4d& theProjR,
stereoProjection(theProjL, theHeadToEyeL, theProjR, theHeadToEyeR);
}
-// =======================================================================
-// function : StereoProjectionF
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::StereoProjectionF(Graphic3d_Mat4& theProjL,
Graphic3d_Mat4& theHeadToEyeL,
Graphic3d_Mat4& theProjR,
stereoProjection(theProjL, theHeadToEyeL, theProjR, theHeadToEyeR);
}
-// =======================================================================
-// function : stereoProjection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
template <typename Elem_t>
void Graphic3d_Camera::stereoProjection(NCollection_Mat4<Elem_t>& theProjL,
NCollection_Mat4<Elem_t>& theHeadToEyeL,
}
}
-// =======================================================================
-// function : SetCustomStereoFrustums
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetCustomStereoFrustums(const Aspect_FrustumLRBT<Standard_Real>& theFrustumL,
const Aspect_FrustumLRBT<Standard_Real>& theFrustumR)
{
InvalidateProjection();
}
-// =======================================================================
-// function : SetCustomStereoProjection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetCustomStereoProjection(const Graphic3d_Mat4d& theProjL,
const Graphic3d_Mat4d& theHeadToEyeL,
const Graphic3d_Mat4d& theProjR,
InvalidateProjection();
}
-// =======================================================================
-// function : SetCustomMonoProjection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::SetCustomMonoProjection(const Graphic3d_Mat4d& theProj)
{
myCustomProjMatM = theProj;
InvalidateProjection();
}
-// =======================================================================
-// function : computeProjection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
template <typename Elem_t>
void Graphic3d_Camera::computeProjection(NCollection_Mat4<Elem_t>& theProjM,
NCollection_Mat4<Elem_t>& theProjL,
}
}
-// =======================================================================
-// function : UpdateOrientation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
template <typename Elem_t>
Graphic3d_Camera::TransformMatrices<Elem_t>& Graphic3d_Camera::UpdateOrientation(
TransformMatrices<Elem_t>& theMatrices) const
return theMatrices; // for inline accessors
}
-// =======================================================================
-// function : InvalidateProjection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::InvalidateProjection()
{
myMatricesD.ResetProjection();
(Standard_Size)Standard_Atomic_Increment(&THE_STATE_COUNTER);
}
-// =======================================================================
-// function : InvalidateOrientation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Camera::InvalidateOrientation()
{
myMatricesD.ResetOrientation();
(Standard_Size)Standard_Atomic_Increment(&THE_STATE_COUNTER);
}
-// =======================================================================
-// function : orthoProj
-// purpose :
-// =======================================================================
+//=================================================================================================
+
template <typename Elem_t>
void Graphic3d_Camera::orthoProj(NCollection_Mat4<Elem_t>& theOutMx,
const Aspect_FrustumLRBT<Elem_t>& theLRBT,
theOutMx.ChangeValue(3, 3) = Elem_t(1.0);
}
-// =======================================================================
-// function : PerspectiveProj
-// purpose :
-// =======================================================================
+//=================================================================================================
+
template <typename Elem_t>
void Graphic3d_Camera::perspectiveProj(NCollection_Mat4<Elem_t>& theOutMx,
const Aspect_FrustumLRBT<Elem_t>& theLRBT,
theOutMx.ChangeValue(3, 3) = Elem_t(0.0);
}
-// =======================================================================
-// function : StereoEyeProj
-// purpose :
-// =======================================================================
+//=================================================================================================
+
template <typename Elem_t>
void Graphic3d_Camera::stereoEyeProj(NCollection_Mat4<Elem_t>& theOutMx,
const Aspect_FrustumLRBT<Elem_t>& theLRBT,
perspectiveProj(theOutMx, aLRBT, theNear, theFar);
}
-// =======================================================================
-// function : LookOrientation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
template <typename Elem_t>
void Graphic3d_Camera::LookOrientation(const NCollection_Vec3<Elem_t>& theEye,
const NCollection_Vec3<Elem_t>& theFwdDir,
theOutMx.Multiply(anAxialScaleMx);
}
-// =======================================================================
-// function : FitMinMax
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_Camera::FitMinMax(const Bnd_Box& theBox,
const Standard_Real theResolution,
const bool theToEnlargeIfLine)
}
} // namespace
-// =======================================================================
-// function : Graphic3d_ClipPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ClipPlane::Graphic3d_ClipPlane()
: myAspect(defaultAspect()),
myPrevInChain(NULL),
makeId();
}
-// =======================================================================
-// function : Graphic3d_ClipPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_Vec4d& theEquation)
: myAspect(defaultAspect()),
myPrevInChain(NULL),
updateInversedPlane();
}
-// =======================================================================
-// function : Graphic3d_ClipPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const Graphic3d_ClipPlane& theOther)
: Standard_Transient(theOther),
myAspect(defaultAspect()),
*myAspect = *theOther.CappingAspect();
}
-// =======================================================================
-// function : Graphic3d_ClipPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ClipPlane::Graphic3d_ClipPlane(const gp_Pln& thePlane)
: myAspect(defaultAspect()),
myPrevInChain(NULL),
makeId();
}
-// =======================================================================
-// function : SetEquation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetEquation(const Graphic3d_Vec4d& theEquation)
{
myPlane = gp_Pln(theEquation.x(), theEquation.y(), theEquation.z(), theEquation.w());
myEquationMod++;
}
-// =======================================================================
-// function : SetPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetEquation(const gp_Pln& thePlane)
{
myPlane = thePlane;
myEquationMod++;
}
-// =======================================================================
-// function : SetOn
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetOn(const Standard_Boolean theIsOn)
{
if (myPrevInChain != NULL)
myIsOn = theIsOn;
}
-// =======================================================================
-// function : SetCapping
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCapping(const Standard_Boolean theIsOn)
{
myIsCapping = theIsOn;
}
-// =======================================================================
-// function : Clone
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ClipPlane) Graphic3d_ClipPlane::Clone() const
{
return new Graphic3d_ClipPlane(*this);
}
-// =======================================================================
-// function : SetCappingColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingColor(const Quantity_Color& theColor)
{
myAspect->SetInteriorColor(theColor);
++myAspectMod;
}
-// =======================================================================
-// function : SetCappingMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingMaterial(const Graphic3d_MaterialAspect& theMat)
{
myAspect->SetFrontMaterial(theMat);
++myAspectMod;
}
-// =======================================================================
-// function : SetCappingTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingTexture(const Handle(Graphic3d_TextureMap)& theTexture)
{
if (!theTexture.IsNull())
++myAspectMod;
}
-// =======================================================================
-// function : SetCappingHatch
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingHatch(const Aspect_HatchStyle theStyle)
{
myAspect->SetHatchStyle(theStyle);
++myAspectMod;
}
-// =======================================================================
-// function : SetCappingCustomHatch
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingCustomHatch(const Handle(Graphic3d_HatchStyle)& theStyle)
{
myAspect->SetHatchStyle(theStyle);
++myAspectMod;
}
-// =======================================================================
-// function : SetCappingHatchOn
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingHatchOn()
{
myAspect->SetInteriorStyle(Aspect_IS_HATCH);
++myAspectMod;
}
-// =======================================================================
-// function : SetCappingHatchOff
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingHatchOff()
{
myAspect->SetInteriorStyle(Aspect_IS_SOLID);
++myAspectMod;
}
-// =======================================================================
-// function : SetCappingAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetCappingAspect(const Handle(Graphic3d_AspectFillArea3d)& theAspect)
{
myAspect = theAspect;
++myAspectMod;
}
-// =======================================================================
-// function : setCappingFlag
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::setCappingFlag(bool theToUse, int theFlag)
{
if (theToUse)
++myAspectMod;
}
-// =======================================================================
-// function : makeId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::makeId()
{
myId = TCollection_AsciiString("Graphic3d_ClipPlane_") // DynamicType()->Name()
+ TCollection_AsciiString(Standard_Atomic_Increment(&THE_CLIP_PLANE_COUNTER));
}
-// =======================================================================
-// function : updateChainLen
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::updateChainLen()
{
myChainLenFwd = !myNextInChain.IsNull() ? (myNextInChain->myChainLenFwd + 1) : 1;
}
}
-// =======================================================================
-// function : SetChainNextPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::SetChainNextPlane(const Handle(Graphic3d_ClipPlane)& thePlane)
{
++myEquationMod;
updateChainLen();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ClipPlane::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CubeMap, Graphic3d_TextureMap)
-// =======================================================================
-// function : Graphic3d_CubeMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMap::Graphic3d_CubeMap(const TCollection_AsciiString& theFileName,
Standard_Boolean theToGenerateMipmaps)
: Graphic3d_TextureMap(theFileName, Graphic3d_TypeOfTexture_CUBEMAP),
myHasMipmaps = theToGenerateMipmaps;
}
-// =======================================================================
-// function : Graphic3d_CubeMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMap::Graphic3d_CubeMap(const Handle(Image_PixMap)& thePixmap,
Standard_Boolean theToGenerateMipmaps)
: Graphic3d_TextureMap(thePixmap, Graphic3d_TypeOfTexture_CUBEMAP),
myHasMipmaps = theToGenerateMipmaps;
}
-// =======================================================================
-// function : ~Graphic3d_CubeMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMap::~Graphic3d_CubeMap()
{
//
#include <bitset>
-// =======================================================================
-// function : Graphic3d_CubeMapOrder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder()
: myConvolution(0),
myHasOverflows(false)
{
}
-// =======================================================================
-// function : Graphic3d_CubeMapOrder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder(unsigned char thePosXLocation,
unsigned char theNegXLocation,
unsigned char thePosYLocation,
Set(Graphic3d_CMS_NEG_Z, theNegZLocation);
}
-// =======================================================================
-// function : Graphic3d_CubeMapOrder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder::Graphic3d_CubeMapOrder(const Graphic3d_ValidatedCubeMapOrder& theOrder)
: myConvolution(theOrder.Order.myConvolution),
myHasOverflows(theOrder.Order.myHasOverflows)
{
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Set(const Graphic3d_CubeMapOrder& theOrder)
{
myConvolution = theOrder.myConvolution;
return *this;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Set(Graphic3d_CubeMapSide theCubeMapSide,
unsigned char theValue)
{
return *this;
}
-// =======================================================================
-// function : Get
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned char Graphic3d_CubeMapOrder::Get(Graphic3d_CubeMapSide theCubeMapSide) const
{
return get(static_cast<unsigned char>(theCubeMapSide));
return Get(theCubeMapSide);
}
-// =======================================================================
-// function : SetDefault
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::SetDefault()
{
for (unsigned char i = 0; i < 6; ++i)
return *this;
}
-// =======================================================================
-// function : Permute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Permute(
const Graphic3d_ValidatedCubeMapOrder& thePermutation)
{
return *this;
}
-// =======================================================================
-// function : Permuted
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Permuted(
const Graphic3d_ValidatedCubeMapOrder& thePermutation) const
{
return anOrder;
}
-// =======================================================================
-// function : Swap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Swap(Graphic3d_CubeMapSide theFirstSide,
Graphic3d_CubeMapSide theSecondSide)
{
return *this;
}
-// =======================================================================
-// function : Swapped
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder Graphic3d_CubeMapOrder::Swapped(Graphic3d_CubeMapSide theFirstSide,
Graphic3d_CubeMapSide theSecondSide) const
{
return anOrder;
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapOrder& Graphic3d_CubeMapOrder::Clear()
{
myConvolution = 0;
return *this;
}
-// =======================================================================
-// function : IsEmpty
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_CubeMapOrder::IsEmpty() const
{
return myConvolution == 0;
}
-// =======================================================================
-// function : HasRepetitions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_CubeMapOrder::HasRepetitions() const
{
std::bitset<6> aBitSet;
return false;
}
-// =======================================================================
-// function : HasOverflows
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_CubeMapOrder::HasOverflows() const
{
return myHasOverflows;
}
-// =======================================================================
-// function : IsValid
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_CubeMapOrder::IsValid() const
{
return !HasRepetitions() && !HasOverflows();
}
-// =======================================================================
-// function : get
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned char Graphic3d_CubeMapOrder::get(unsigned char theCubeMapSide) const
{
return (myConvolution / (1 << (theCubeMapSide * 3))) % (1 << 3);
}
-// =======================================================================
-// function : set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CubeMapOrder::set(unsigned char theCubeMapSide, unsigned char theValue)
{
unsigned int aValuePlace = 1 << (theCubeMapSide * 3);
myConvolution += aValuePlace * theValue;
}
-// =======================================================================
-// function : set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CubeMapOrder::set(Graphic3d_CubeMapSide theCubeMapSide, unsigned char theValue)
{
set(static_cast<unsigned char>(theCubeMapSide), theValue);
}
-// =======================================================================
-// function : Default
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_ValidatedCubeMapOrder& Graphic3d_CubeMapOrder::Default()
{
static const Graphic3d_ValidatedCubeMapOrder aCubeMapOrder =
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CubeMapPacked, Graphic3d_CubeMap)
-// =======================================================================
-// function : Graphic3d_CubeMapPacked
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked(const TCollection_AsciiString& theFilePath,
const Graphic3d_ValidatedCubeMapOrder& theOrder)
: Graphic3d_CubeMap(theFilePath),
{
}
-// =======================================================================
-// function : Graphic3d_CubeMapPacked
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapPacked::Graphic3d_CubeMapPacked(const Handle(Image_PixMap)& theImage,
const Graphic3d_ValidatedCubeMapOrder& theOrder)
: Graphic3d_CubeMap(Handle(Image_PixMap)()),
}
}
-// =======================================================================
-// function : CompressedValue
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_CompressedPixMap) Graphic3d_CubeMapPacked::CompressedValue(
const Handle(Image_SupportedFormats)& theSupported)
{
return Handle(Image_CompressedPixMap)();
}
-// =======================================================================
-// function : Value
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Graphic3d_CubeMapPacked::Value(
const Handle(Image_SupportedFormats)& theSupported)
{
return Handle(Image_PixMap)();
}
-// =======================================================================
-// function : checkOrder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_CubeMapPacked::checkOrder(
const NCollection_Array1<unsigned int>& theOrder)
{
return anOrderIsValid;
}
-// =======================================================================
-// function : checkImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_CubeMapPacked::checkImage(const Handle(Image_PixMap)& theImage,
unsigned int& theTileNumberX)
{
return Standard_True;
}
-// =======================================================================
-// function : tryLoadImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CubeMapPacked::tryLoadImage(const Handle(Image_SupportedFormats)& theSupported,
const TCollection_AsciiString& theFilePath)
{
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_CubeMapSeparate, Graphic3d_CubeMap)
-// =======================================================================
-// function : Graphic3d_CubeMapSeparate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapSeparate::Graphic3d_CubeMapSeparate(
const NCollection_Array1<TCollection_AsciiString>& thePaths)
{
}
}
-// =======================================================================
-// function : Graphic3d_CubeMapSeparate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CubeMapSeparate::Graphic3d_CubeMapSeparate(
const NCollection_Array1<Handle(Image_PixMap)>& theImages)
{
}
}
-// =======================================================================
-// function : CompressedValue
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_CompressedPixMap) Graphic3d_CubeMapSeparate::CompressedValue(
const Handle(Image_SupportedFormats)& theSupported)
{
return Handle(Image_CompressedPixMap)();
}
-// =======================================================================
-// function : Value
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Graphic3d_CubeMapSeparate::Value(
const Handle(Image_SupportedFormats)& theSupported)
{
return Handle(Image_PixMap)();
}
-// =======================================================================
-// function : IsDone
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_CubeMapSeparate::IsDone() const
{
if (!myImages[0].IsNull())
return Standard_True;
}
-// =======================================================================
-// function : resetImages
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CubeMapSeparate::resetImages()
{
for (unsigned int i = 0; i < 6; ++i)
#include <limits>
-// =======================================================================
-// function : Graphic3d_CullingTool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_CullingTool::Graphic3d_CullingTool()
: myClipVerts(0, Graphic3d_Camera::FrustumVerticesNB),
myIsProjectionParallel(Standard_True),
//
}
-// =======================================================================
-// function : SetViewVolume
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CullingTool::SetViewVolume(const Handle(Graphic3d_Camera)& theCamera,
const Graphic3d_Mat4d& theModelWorld)
{
}
}
-// =======================================================================
-// function : SetViewportSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CullingTool::SetViewportSize(Standard_Integer theViewportWidth,
Standard_Integer theViewportHeight,
Standard_Real theResolutionRatio)
myPixelSize = Max(theResolutionRatio / myViewportHeight, theResolutionRatio / myViewportWidth);
}
-// =======================================================================
-// function : SignedPlanePointDistance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Graphic3d_CullingTool::SignedPlanePointDistance(const Graphic3d_Vec4d& theNormal,
const Graphic3d_Vec4d& thePnt)
{
return aD + (anA * thePnt.x() + aB * thePnt.y() + aC * thePnt.z());
}
-// =======================================================================
-// function : SetCullingDistance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CullingTool::SetCullingDistance(CullingContext& theCtx,
Standard_Real theDistance) const
{
}
}
-// =======================================================================
-// function : SetCullingSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CullingTool::SetCullingSize(CullingContext& theCtx, Standard_Real theSize) const
{
theCtx.SizeCull2 = -1.0;
}
}
-// =======================================================================
-// function : CacheClipPtsProjections
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_CullingTool::CacheClipPtsProjections()
{
// project frustum onto its own normals
}
} // namespace
-// =======================================================================
-// function : Graphic3d_FrameStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_FrameStats::Graphic3d_FrameStats()
: myFpsTimer(Standard_True),
myFrameStartTime(0.0),
//
}
-// =======================================================================
-// function : ~Graphic3d_FrameStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_FrameStats::~Graphic3d_FrameStats()
{
//
}
-// =======================================================================
-// function : FormatStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_FrameStats::FormatStats(
Graphic3d_RenderingParams::PerfCounters theFlags) const
{
return TCollection_AsciiString(aBuf.str().c_str());
}
-// =======================================================================
-// function : FormatStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_FrameStats::FormatStats(TColStd_IndexedDataMapOfStringString& theDict,
Graphic3d_RenderingParams::PerfCounters theFlags) const
{
}
}
-// =======================================================================
-// function : FrameStart
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_FrameStats::FrameStart(const Handle(Graphic3d_CView)& theView,
bool theIsImmediateOnly)
{
}
}
-// =======================================================================
-// function : FrameEnd
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_FrameStats::FrameEnd(const Handle(Graphic3d_CView)& theView, bool theIsImmediateOnly)
{
const Graphic3d_RenderingParams::PerfCounters aBits =
#include <Graphic3d_FrameStatsData.hxx>
-// =======================================================================
-// function : Graphic3d_FrameStatsData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_FrameStatsData::Graphic3d_FrameStatsData()
: myFps(-1.0),
myFpsCpu(-1.0),
Reset();
}
-// =======================================================================
-// function : Graphic3d_FrameStatsData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_FrameStatsData::Graphic3d_FrameStatsData(const Graphic3d_FrameStatsData& theOther)
: myCounters(theOther.myCounters),
myTimers(theOther.myTimers),
{
}
-// =======================================================================
-// function : Graphic3d_FrameStatsData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_FrameStatsData::Graphic3d_FrameStatsData(Graphic3d_FrameStatsData&& theOther) noexcept
: myCounters(std::move(theOther.myCounters)),
myTimers(std::move(theOther.myTimers)),
return *this;
}
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_FrameStatsData::Reset()
{
myFps = -1.0;
myTimersMax.assign(myTimersMax.size(), 0.0);
}
-// =======================================================================
-// function : FillMax
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_FrameStatsData::FillMax(const Graphic3d_FrameStatsData& theOther)
{
myFps = Max(myFps, theOther.myFps);
}
}
-// =======================================================================
-// function : Graphic3d_FrameStatsDataTmp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_FrameStatsDataTmp::Graphic3d_FrameStatsDataTmp()
{
myOsdTimers.resize(Graphic3d_FrameStatsTimer_NB, OSD_Timer(true));
myTimersPrev.resize(Graphic3d_FrameStatsTimer_NB, 0.0);
}
-// =======================================================================
-// function : FlushTimers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_FrameStatsDataTmp::FlushTimers(Standard_Size theNbFrames, bool theIsFinal)
{
for (size_t aTimerIter = 0; aTimerIter < myTimers.size(); ++aTimerIter)
}
}
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_FrameStatsDataTmp::Reset()
{
Graphic3d_FrameStatsData::Reset();
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_GraphicDriver, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_GraphicDriver
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_GraphicDriver::Graphic3d_GraphicDriver(const Handle(Aspect_DisplayConnection)& theDisp)
: myDisplayConnection(theDisp)
{
}
}
-// =======================================================================
-// function : GetDisplayConnection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Aspect_DisplayConnection)& Graphic3d_GraphicDriver::GetDisplayConnection() const
{
return myDisplayConnection;
}
-// =======================================================================
-// function : NewIdentification
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_GraphicDriver::NewIdentification()
{
return myStructGenId.Next();
}
-// =======================================================================
-// function : RemoveIdentification
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_GraphicDriver::RemoveIdentification(const Standard_Integer theId)
{
myStructGenId.Free(theId);
aLayerDef->SetLayerSettings(theSettings);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_GraphicDriver::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
}
} // namespace
-// =======================================================================
-// function : DriverFactories
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Graphic3d_GraphicDriverFactoryList& Graphic3d_GraphicDriverFactory::DriverFactories()
{
return getDriverFactories();
}
-// =======================================================================
-// function : RegisterFactory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_GraphicDriverFactory::RegisterFactory(
const Handle(Graphic3d_GraphicDriverFactory)& theFactory,
bool theIsPreferred)
aFactories.Append(theFactory);
}
-// =======================================================================
-// function : UnregisterFactory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_GraphicDriverFactory::UnregisterFactory(const TCollection_AsciiString& theName)
{
Graphic3d_GraphicDriverFactoryList& aFactories = getDriverFactories();
}
}
-// =======================================================================
-// function : DefaultDriverFactory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_GraphicDriverFactory) Graphic3d_GraphicDriverFactory::DefaultDriverFactory()
{
const Graphic3d_GraphicDriverFactoryList& aMap = getDriverFactories();
return !aMap.IsEmpty() ? aMap.First() : Handle(Graphic3d_GraphicDriverFactory)();
}
-// =======================================================================
-// function : Graphic3d_GraphicDriverFactory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_GraphicDriverFactory::Graphic3d_GraphicDriverFactory(
const TCollection_AsciiString& theName)
: myName(theName)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Group, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_Group
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Group::Graphic3d_Group(const Handle(Graphic3d_Structure)& theStruct)
: myStructure(theStruct.operator->()),
myIsClosed(false)
//
}
-// =======================================================================
-// function : ~Graphic3d_Group
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Group::~Graphic3d_Group()
{
// tell graphics driver to clear internal resources of the group
Clear(Standard_False);
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Clear(Standard_Boolean theUpdateStructureMgr)
{
if (IsDeleted())
}
}
-// =======================================================================
-// function : Remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Remove()
{
if (IsDeleted())
myBounds.Clear();
}
-// =======================================================================
-// function : IsDeleted
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_Group::IsDeleted() const
{
return myStructure == NULL || myStructure->IsDeleted();
}
-// =======================================================================
-// function : IsEmpty
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_Group::IsEmpty() const
{
if (IsDeleted())
return !myStructure->IsInfinite() && !myBounds.IsValid();
}
-// =======================================================================
-// function : SetTransformPersistence
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::SetTransformPersistence(const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
if (myTrsfPers != theTrsfPers)
}
}
-// =======================================================================
-// function : SetMinMaxValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::SetMinMaxValues(const Standard_Real theXMin,
const Standard_Real theYMin,
const Standard_Real theZMin,
1.0f));
}
-// =======================================================================
-// function : Structure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_Structure) Graphic3d_Group::Structure() const
{
return myStructure;
}
-// =======================================================================
-// function : MinMaxValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::MinMaxValues(Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
}
}
-// =======================================================================
-// function : Update
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Update() const
{
if (IsDeleted())
myStructure->StructureManager()->Update();
}
-// =======================================================================
-// function : AddPrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::AddPrimitiveArray(const Handle(Graphic3d_ArrayOfPrimitives)& thePrim,
const Standard_Boolean theToEvalMinMax)
{
theToEvalMinMax);
}
-// =======================================================================
-// function : AddPrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::AddPrimitiveArray(const Graphic3d_TypeOfPrimitiveArray theType,
const Handle(Graphic3d_IndexBuffer)&,
const Handle(Graphic3d_Buffer)& theAttribs,
Update();
}
-// =======================================================================
-// function : Marker
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Marker(const Graphic3d_Vertex& thePoint,
const Standard_Boolean theToEvalMinMax)
{
AddPrimitiveArray(aPoints, theToEvalMinMax);
}
-// =======================================================================
-// function : Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Text(const Standard_CString theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
AddText(aText, theToEvalMinMax);
}
-// =======================================================================
-// function : Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Text(const Standard_CString theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
AddText(aText, theToEvalMinMax);
}
-// =======================================================================
-// function : Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
AddText(aText, theToEvalMinMax);
}
-// =======================================================================
-// function : Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
const gp_Ax2& theOrientation,
const Standard_Real theHeight,
AddText(aText, theToEvalMinMax);
}
-// =======================================================================
-// function : Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Text(const Standard_CString theText,
const gp_Ax2& theOrientation,
const Standard_Real theHeight,
AddText(aText, theToEvalMinMax);
}
-// =======================================================================
-// function : Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::Text(const TCollection_ExtendedString& theText,
const Graphic3d_Vertex& thePoint,
const Standard_Real theHeight,
AddText(aText, theToEvalMinMax);
}
-// =======================================================================
-// function : AddText
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::AddText(const Handle(Graphic3d_Text)& theTextParams,
const Standard_Boolean theToEvalMinMax)
{
Update();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Group::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Layer, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_Layer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Layer::Graphic3d_Layer(Graphic3d_ZLayerId theId, const Handle(BVH_Builder3d)& theBuilder)
: myNbStructures(0),
myNbStructuresNotCulled(0),
myIsBoundingBoxNeedsReset[0] = myIsBoundingBoxNeedsReset[1] = true;
}
-// =======================================================================
-// function : ~Graphic3d_Layer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Layer::~Graphic3d_Layer()
{
//
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Layer::Add(const Graphic3d_CStructure* theStruct,
Graphic3d_DisplayPriority thePriority,
Standard_Boolean isForChangePriority)
++myNbStructures;
}
-// =======================================================================
-// function : Remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_Layer::Remove(const Graphic3d_CStructure* theStruct,
Graphic3d_DisplayPriority& thePriority,
Standard_Boolean isForChangePriority)
return false;
}
-// =======================================================================
-// function : InvalidateBVHData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Layer::InvalidateBVHData()
{
myIsBVHPrimitivesNeedsReset = Standard_True;
}
}
-// =======================================================================
-// function : BoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Bnd_Box Graphic3d_Layer::BoundingBox(Standard_Integer theViewId,
const Handle(Graphic3d_Camera)& theCamera,
Standard_Integer theWindowWidth,
return aResBox;
}
-// =======================================================================
-// function : considerZoomPersistenceObjects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Graphic3d_Layer::considerZoomPersistenceObjects(
Standard_Integer theViewId,
const Handle(Graphic3d_Camera)& theCamera,
return (aMaxCoef > 0.0) ? aMaxCoef : 1.0;
}
-// =======================================================================
-// function : updateBVH
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Layer::updateBVH() const
{
if (!myIsBVHPrimitivesNeedsReset)
};
} // namespace
-// =======================================================================
-// function : UpdateCulling
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Layer::UpdateCulling(
Standard_Integer theViewId,
const Graphic3d_CullingTool& theSelector,
}
}
-// =======================================================================
-// function : Append
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_Layer::Append(const Graphic3d_Layer& theOther)
{
// add all structures to destination priority list
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Layer::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
};
} // namespace
-// =======================================================================
-// function : Graphic3d_LightSet
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_LightSet::Graphic3d_LightSet()
: myAmbient(0.0f, 0.0f, 0.0f, 0.0f),
myNbEnabled(0),
memset(myLightTypesEnabled, 0, sizeof(myLightTypesEnabled));
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_LightSet::Add(const Handle(Graphic3d_CLight)& theLight)
{
if (theLight.IsNull())
return Standard_True;
}
-// =======================================================================
-// function : Remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_LightSet::Remove(const Handle(Graphic3d_CLight)& theLight)
{
const Standard_Integer anIndToRemove = myLights.FindIndex(theLight);
return Standard_True;
}
-// =======================================================================
-// function : UpdateRevision
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size Graphic3d_LightSet::UpdateRevision()
{
if (myCacheRevision == myRevision)
}
} // namespace
-// =======================================================================
-// function : Graphic3d_MarkerImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_MarkerImage::Graphic3d_MarkerImage(const Handle(Image_PixMap)& theImage,
const Handle(Image_PixMap)& theImageAlpha)
: myImage(theImage),
}
}
-// =======================================================================
-// function : Graphic3d_MarkerImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_MarkerImage::Graphic3d_MarkerImage(const TCollection_AsciiString& theId,
const TCollection_AsciiString& theAlphaId,
const Handle(Image_PixMap)& theImage,
}
}
-// =======================================================================
-// function : Graphic3d_MarkerImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_MarkerImage::Graphic3d_MarkerImage(const Handle(TColStd_HArray1OfByte)& theBitMap,
const Standard_Integer theWidth,
const Standard_Integer theHeight)
+ TCollection_AsciiString(THE_MARKER_IMAGE_COUNTER);
}
-// =======================================================================
-// function : IsColoredImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_MarkerImage::IsColoredImage() const
{
return !myImage.IsNull() && myImage->Format() != Image_Format_Alpha
&& myImage->Format() != Image_Format_Gray;
}
-// =======================================================================
-// function : GetBitMapArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(TColStd_HArray1OfByte) Graphic3d_MarkerImage::GetBitMapArray(
const Standard_Real theAlphaValue,
const Standard_Boolean theIsTopDown) const
return aBitMap;
}
-// =======================================================================
-// function : GetImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImage()
{
if (!myImage.IsNull() || myBitMap.IsNull())
return myImage;
}
-// =======================================================================
-// function : GetImageAlpha
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Image_PixMap)& Graphic3d_MarkerImage::GetImageAlpha()
{
if (!myImageAlpha.IsNull())
return myImageAlpha;
}
-// =======================================================================
-// function : GetImageId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const TCollection_AsciiString& Graphic3d_MarkerImage::GetImageId() const
{
return myImageId;
}
-// =======================================================================
-// function : GetImageAlphaId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const TCollection_AsciiString& Graphic3d_MarkerImage::GetImageAlphaId() const
{
return myImageAlphaId;
}
-// =======================================================================
-// function : GetTextureSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MarkerImage::GetTextureSize(Standard_Integer& theWidth,
Standard_Integer& theHeight) const
{
theHeight = myHeight;
}
-// =======================================================================
-// function : GetMarkerImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_MarkerImage) Graphic3d_MarkerImage::StandardMarker(
const Aspect_TypeOfMarker theMarkerType,
const Standard_ShortReal theScale,
RawMaterial(Graphic3d_NameOfMaterial_UserDefined, "UserDefined")};
} // namespace
-// =======================================================================
-// function : RawMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RawMaterial::RawMaterial(Graphic3d_NameOfMaterial theName, const char* theStringName)
: StringName(theStringName),
BSDF(Graphic3d_BSDF::CreateDiffuse(Graphic3d_Vec3(0.0f))),
PBRMaterial.SetBSDF(BSDF);
}
-// =======================================================================
-// function : Graphic3d_MaterialAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
: myRequestedMaterialName(Graphic3d_NameOfMaterial_DEFAULT)
{
init(Graphic3d_NameOfMaterial_DEFAULT);
}
-// =======================================================================
-// function : Graphic3d_MaterialAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect(const Graphic3d_NameOfMaterial theName)
: myRequestedMaterialName(theName)
{
init(theName);
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::init(const Graphic3d_NameOfMaterial theName)
{
const RawMaterial& aMat = THE_MATERIALS[theName];
myRequestedMaterialName = theName;
}
-// =======================================================================
-// function : IncreaseShine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::IncreaseShine(const Standard_ShortReal theDelta)
{
const Standard_ShortReal anOldShine = myShininess;
}
}
-// =======================================================================
-// function : SetMaterialType
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetMaterialType(const Graphic3d_TypeOfMaterial theType)
{
myMaterialType = theType;
}
}
-// =======================================================================
-// function : SetColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_ASPECT)
myColors[Graphic3d_TOR_DIFFUSE] = aDiffuse;
}
-// =======================================================================
-// function : SetAmbientColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetAmbientColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
myColors[Graphic3d_TOR_AMBIENT] = theColor;
}
-// =======================================================================
-// function : SetDiffuseColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetDiffuseColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
myColors[Graphic3d_TOR_DIFFUSE] = theColor;
}
-// =======================================================================
-// function : SetSpecularColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetSpecularColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
myColors[Graphic3d_TOR_SPECULAR] = theColor;
}
-// =======================================================================
-// function : SetEmissiveColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetEmissiveColor(const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
myColors[Graphic3d_TOR_EMISSION] = theColor;
}
-// =======================================================================
-// function : SetTransparency
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetTransparency(const Standard_ShortReal theValue)
{
if (theValue < 0.0f || theValue > 1.0f)
myPBRMaterial.SetAlpha(1.0f - theValue);
}
-// =======================================================================
-// function : SetRefractionIndex
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetRefractionIndex(const Standard_ShortReal theValue)
{
if (theValue < 1.0f)
myRefractionIndex = theValue;
}
-// =======================================================================
-// function : SetShininess
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MaterialAspect::SetShininess(const Standard_ShortReal theValue)
{
if (theValue < 0.0f || theValue > 1.0f)
}
}
-// =======================================================================
-// function : MaterialName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CString Graphic3d_MaterialAspect::MaterialName(const Standard_Integer theRank)
{
if (theRank < 1 || theRank > NumberOfMaterials())
return aMat.StringName;
}
-// =======================================================================
-// function : MaterialFromName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_MaterialAspect::MaterialFromName(const Standard_CString theName,
Graphic3d_NameOfMaterial& theMat)
{
return Standard_False;
}
-// =======================================================================
-// function : MaterialType
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TypeOfMaterial Graphic3d_MaterialAspect::MaterialType(const Standard_Integer theRank)
{
if (theRank < 1 || theRank > NumberOfMaterials())
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MediaTexture, Graphic3d_Texture2D)
-// ================================================================
-// Function : Graphic3d_MediaTexture
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Graphic3d_MediaTexture::Graphic3d_MediaTexture(const Handle(Standard_HMutex)& theMutex,
Standard_Integer thePlane)
: Graphic3d_Texture2D("", Graphic3d_TypeOfTexture_2D),
myParams->SetTextureUnit(Graphic3d_TextureUnit(int(Graphic3d_TextureUnit_0) + thePlane));
}
-// ================================================================
-// Function : GetImage
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Graphic3d_MediaTexture::GetImage(const Handle(Image_SupportedFormats)&)
{
Standard_Mutex::Sentry aLock(myMutex.get());
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_MediaTextureSet, Graphic3d_TextureSet)
-// ================================================================
-// Function : Graphic3d_MediaTexture
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Graphic3d_MediaTextureSet::Graphic3d_MediaTextureSet()
: Graphic3d_TextureSet(4),
myMutex(new Standard_HMutex()),
aSrcFrag + F_SHADER_YUV2RGB_FULL));
}
-// =======================================================================
-// function : SetCallback
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MediaTextureSet::SetCallback(CallbackOnUpdate_t theCallbackFunction,
void* theCallbackUserPtr)
{
myCallbackUserPtr = theCallbackUserPtr;
}
-// =======================================================================
-// function : Notify
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MediaTextureSet::Notify()
{
if (myCallbackFunction != NULL)
}
}
-// =======================================================================
-// function : OpenInput
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MediaTextureSet::OpenInput(const TCollection_AsciiString& thePath,
Standard_Boolean theToWait)
{
myInput = thePath;
}
-// =======================================================================
-// function : LockFrame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Media_Frame) Graphic3d_MediaTextureSet::LockFrame()
{
{
return Handle(Media_Frame)();
}
-// =======================================================================
-// function : ReleaseFrame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_MediaTextureSet::ReleaseFrame(const Handle(Media_Frame)& theFrame)
{
{
}
}
-// ================================================================
-// Function : SwapFrames
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_MediaTextureSet::SwapFrames()
{
if (myPlayerCtx.IsNull())
#include <limits>
-// =======================================================================
-// function : RoughnessFromSpecular
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal Graphic3d_PBRMaterial::RoughnessFromSpecular(const Quantity_Color& theSpecular,
const Standard_Real theShiness)
{
return (Standard_ShortReal)aRoughnessFactor;
}
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_PBRMaterial::Graphic3d_PBRMaterial()
: myColor(0.f, 0.f, 0.f, 1.f),
myMetallic(0.f),
{
}
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_PBRMaterial::Graphic3d_PBRMaterial(const Graphic3d_BSDF& theBSDF)
{
SetBSDF(theBSDF);
}
-// =======================================================================
-// function : SetMetallic
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetMetallic(Standard_ShortReal theMetallic)
{
Graphic3d_MaterialDefinitionError_Raise_if(
"'metallic' parameter of PBR material must be in range [0, 1]") myMetallic = theMetallic;
}
-// =======================================================================
-// function : Roughness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal Graphic3d_PBRMaterial::Roughness(Standard_ShortReal theNormalizedRoughness)
{
return theNormalizedRoughness * (1.f - MinRoughness()) + MinRoughness();
}
-// =======================================================================
-// function : SetRoughness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetRoughness(Standard_ShortReal theRoughness)
{
Graphic3d_MaterialDefinitionError_Raise_if(
"'roughness' parameter of PBR material must be in range [0, 1]") myRoughness = theRoughness;
}
-// =======================================================================
-// function : SetIOR
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetIOR(Standard_ShortReal theIOR)
{
Graphic3d_MaterialDefinitionError_Raise_if(
"'IOR' parameter of PBR material must be in range [1, 3]") myIOR = theIOR;
}
-// =======================================================================
-// function : SetColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetColor(const Quantity_ColorRGBA& theColor)
{
myColor.SetRGB(theColor.GetRGB());
SetAlpha(theColor.Alpha());
}
-// =======================================================================
-// function : SetColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetColor(const Quantity_Color& theColor)
{
myColor.SetRGB(theColor);
}
-// =======================================================================
-// function : SetAlpha
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetAlpha(Standard_ShortReal theAlpha)
{
Graphic3d_MaterialDefinitionError_Raise_if(
"'alpha' parameter of PBR material must be in range [0, 1]") myColor.SetAlpha(theAlpha);
}
-// =======================================================================
-// function : SetEmission
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetEmission(const Graphic3d_Vec3& theEmission)
{
Graphic3d_MaterialDefinitionError_Raise_if(
theEmission;
}
-// =======================================================================
-// function : SetBSDF
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::SetBSDF(const Graphic3d_BSDF& theBSDF)
{
SetEmission(theBSDF.Le);
}
}
-// =======================================================================
-// function : GenerateEnvLUT
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PBRMaterial::GenerateEnvLUT(const Handle(Image_PixMap)& theLUT,
unsigned int theNbIntegralSamples)
{
}
}
-// =======================================================================
-// function : SpecIBLMapSamplesFactor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal Graphic3d_PBRMaterial::SpecIBLMapSamplesFactor(Standard_ShortReal theProbability,
Standard_ShortReal theRoughness)
{
/ Standard_ShortReal(M_PI);
}
-// =======================================================================
-// function : lutGenGeometryFactor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal Graphic3d_PBRMaterial::lutGenGeometryFactor(Standard_ShortReal theCosL,
Standard_ShortReal theCosV,
Standard_ShortReal theRoughness)
return aGeometryFactor;
}
-// =======================================================================
-// function : lutGenHammersley
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec2 Graphic3d_PBRMaterial::lutGenHammersley(unsigned int theNumber,
unsigned int theCount)
{
return Graphic3d_Vec2(theNumber / Standard_ShortReal(theCount), aPhi2);
}
-// =======================================================================
-// function : lutGenImportanceSampleCosTheta
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal Graphic3d_PBRMaterial::lutGenImportanceSampleCosTheta(
Standard_ShortReal theHammersleyPointComponent,
Standard_ShortReal theRoughness)
}
}
-// =======================================================================
-// function : lutGenImportanceSample
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec3 Graphic3d_PBRMaterial::lutGenImportanceSample(
const Graphic3d_Vec2& theHammerslayPoint,
Standard_ShortReal theRoughness)
return Graphic3d_Vec3(aSinTheta * cosf(aPhi), aSinTheta * sinf(aPhi), aCosTheta);
}
-// =======================================================================
-// function : lutGenView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec3 Graphic3d_PBRMaterial::lutGenView(Standard_ShortReal theCosV)
{
return Graphic3d_Vec3(0.f, sqrtf(1.f - theCosV * theCosV), theCosV);
}
-// =======================================================================
-// function : lutGenReflect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec3 Graphic3d_PBRMaterial::lutGenReflect(const Graphic3d_Vec3& theVector,
const Graphic3d_Vec3& theAxis)
{
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_PresentationAttributes, Standard_Transient)
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_PresentationAttributes::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_SequenceOfHClipPlane, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_SequenceOfHClipPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_SequenceOfHClipPlane::Graphic3d_SequenceOfHClipPlane()
: myToOverrideGlobal(Standard_False)
{
//
}
-// =======================================================================
-// function : Append
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_SequenceOfHClipPlane::Append(const Handle(Graphic3d_ClipPlane)& theItem)
{
for (NCollection_Sequence<Handle(Graphic3d_ClipPlane)>::Iterator anItemIter(myItems);
return true;
}
-// =======================================================================
-// function : Remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_SequenceOfHClipPlane::Remove(const Handle(Graphic3d_ClipPlane)& theItem)
{
for (NCollection_Sequence<Handle(Graphic3d_ClipPlane)>::Iterator anItemIter(myItems);
return false;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_SequenceOfHClipPlane::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ShaderAttribute, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_ShaderAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ShaderAttribute::Graphic3d_ShaderAttribute(const TCollection_AsciiString& theName,
const int theLocation)
: myName(theName),
//
}
-// =======================================================================
-// function : ~Graphic3d_ShaderAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ShaderAttribute::~Graphic3d_ShaderAttribute()
{
//
} // namespace
-// =======================================================================
-// function : genLightKey
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_ShaderManager::genLightKey(
const Handle(Graphic3d_LightSet)& theLights,
const bool theHasShadowMap) const
return TCollection_AsciiString("l_") + theLights->KeyEnabledShort() + aMaxLimit;
}
-// =======================================================================
-// function : Graphic3d_ShaderManager
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ShaderManager::Graphic3d_ShaderManager(Aspect_GraphicsLibrary theGapi)
: myGapi(theGapi),
// desktop defines a dedicated API for point size, with gl_PointSize added later to GLSL
memset(myGlslExtensions, 0, sizeof(myGlslExtensions));
}
-// =======================================================================
-// function : ~Graphic3d_ShaderManager
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ShaderManager::~Graphic3d_ShaderManager()
{
//
}
-// =======================================================================
-// function : hasGlslBitwiseOps
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Graphic3d_ShaderManager::hasGlslBitwiseOps() const
{
switch (myGapi)
return false;
}
-// =======================================================================
-// function : defaultGlslVersion
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Graphic3d_ShaderManager::defaultGlslVersion(const Handle(Graphic3d_ShaderProgram)& theProgram,
const TCollection_AsciiString& theName,
int theBits,
return aBits;
}
-// =======================================================================
-// function : defaultOitGlslVersion
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ShaderManager::defaultOitGlslVersion(
const Handle(Graphic3d_ShaderProgram)& theProgram,
const TCollection_AsciiString& theName,
theProgram->SetId(TCollection_AsciiString("occt_") + theName + (theMsaa ? "_msaa" : ""));
}
-// =======================================================================
-// function : getStdProgramFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramFont() const
{
Graphic3d_ShaderObject::ShaderVariableList aUniforms, aStageInOuts;
return aProgramSrc;
}
-// =======================================================================
-// function : getStdProgramFboBlit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramFboBlit(
Standard_Integer theNbSamples,
Standard_Boolean theIsFallback_sRGB) const
return aProgramSrc;
}
-// =======================================================================
-// function : getStdProgramOitCompositing
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramOitCompositing(
const Standard_Boolean theMsaa) const
{
return aProgramSrc;
}
-// =======================================================================
-// function : getStdProgramOitDepthPeelingBlend
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramOitDepthPeelingBlend(
Standard_Boolean theMsaa) const
{
return aProgramSrc;
}
-// =======================================================================
-// function : getStdProgramOitDepthPeelingFlush
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramOitDepthPeelingFlush(
Standard_Boolean theMsaa) const
{
return aProgramSrc;
}
-// =======================================================================
-// function : pointSpriteAlphaSrc
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_ShaderManager::pointSpriteAlphaSrc(Standard_Integer theBits) const
{
const bool isAlpha =
"occTexture2D(occSamplerPointSprite, " THE_VEC2_glPointCoord ").a; }";
}
-// =======================================================================
-// function : pointSpriteShadingSrc
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_ShaderManager::pointSpriteShadingSrc(
const TCollection_AsciiString& theBaseColorSrc,
Standard_Integer theBits) const
return aSrcMainGeom;
}
-// =======================================================================
-// function : getStdProgramUnlit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramUnlit(
Standard_Integer theBits,
Standard_Boolean theIsOutline) const
return aProgramSrc;
}
-// =======================================================================
-// function : stdComputeLighting
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_ShaderManager::stdComputeLighting(
Standard_Integer& theNbLights,
const Handle(Graphic3d_LightSet)& theLights,
}
}
-// =======================================================================
-// function : getStdProgramGouraud
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramGouraud(
const Handle(Graphic3d_LightSet)& theLights,
Standard_Integer theBits) const
return aProgramSrc;
}
-// =======================================================================
-// function : getStdProgramPhong
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramPhong(
const Handle(Graphic3d_LightSet)& theLights,
const Standard_Integer theBits,
return aProgramSrc;
}
-// =======================================================================
-// function : getStdProgramStereo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramStereo(
Graphic3d_StereoMode theStereoMode) const
{
return aProgramSrc;
}
-// =======================================================================
-// function : getStdProgramBoundBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getStdProgramBoundBox() const
{
Handle(Graphic3d_ShaderProgram) aProgramSrc = new Graphic3d_ShaderProgram();
return aProgramSrc;
}
-// =======================================================================
-// function : getPBREnvBakingProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getPBREnvBakingProgram(
Standard_Integer theIndex) const
{
return aProgramSrc;
}
-// =======================================================================
-// function : getBgCubeMapProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getBgCubeMapProgram() const
{
Handle(Graphic3d_ShaderProgram) aProgSrc = new Graphic3d_ShaderProgram();
return aProgSrc;
}
-// =======================================================================
-// function : getBgSkydomeProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getBgSkydomeProgram() const
{
Handle(Graphic3d_ShaderProgram) aProgSrc = new Graphic3d_ShaderProgram();
return aProgSrc;
}
-// =======================================================================
-// function : getColoredQuadProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderProgram) Graphic3d_ShaderManager::getColoredQuadProgram() const
{
Handle(Graphic3d_ShaderProgram) aProgSrc = new Graphic3d_ShaderProgram();
return !mySource.IsEmpty();
}
-// =======================================================================
-// function : CreateFromSource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ShaderObject) Graphic3d_ShaderObject::CreateFromSource(
TCollection_AsciiString& theSource,
Graphic3d_TypeOfShaderObject theType,
static volatile Standard_Integer THE_PROGRAM_OBJECT_COUNTER = 0;
}
-// =======================================================================
-// function : ShadersFolder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const TCollection_AsciiString& Graphic3d_ShaderProgram::ShadersFolder()
{
static Standard_Boolean THE_IS_DEFINED = Standard_False;
myVariables.Clear();
}
-// =======================================================================
-// function : SetAttributes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ShaderProgram::SetVertexAttributes(
const Graphic3d_ShaderAttributeList& theAttributes)
{
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
#include <Graphic3d_CView.hxx>
-// ========================================================================
-// function : Graphic3d_StructureManager
-// purpose :
-// ========================================================================
+//=================================================================================================
+
Graphic3d_StructureManager::Graphic3d_StructureManager(
const Handle(Graphic3d_GraphicDriver)& theDriver)
: myViewGenId(0, 31),
//
}
-// ========================================================================
-// function : ~Graphic3d_StructureManager
-// purpose :
-// ========================================================================
+//=================================================================================================
+
Graphic3d_StructureManager::~Graphic3d_StructureManager()
{
for (Graphic3d_MapIteratorOfMapOfStructure anIt(myDisplayedStructure); anIt.More(); anIt.Next())
myDefinedViews.Clear();
}
-// ========================================================================
-// function : Update
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Update(const Graphic3d_ZLayerId theLayerId) const
{
for (Graphic3d_IndexedMapOfView::Iterator aViewIt(myDefinedViews); aViewIt.More(); aViewIt.Next())
}
}
-// ========================================================================
-// function : Remove
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Remove()
{
// clear all structures whilst views are alive for correct GPU memory management
myDefinedViews.Clear();
}
-// ========================================================================
-// function : Erase
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Erase()
{
for (Graphic3d_MapIteratorOfMapOfStructure anIt(myDisplayedStructure); anIt.More(); anIt.Next())
}
}
-// ========================================================================
-// function : RegisterObject
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::RegisterObject(const Handle(Standard_Transient)& theObject,
const Handle(Graphic3d_ViewAffinity)& theAffinity)
{
myRegisteredObjects.Bind(theObject.operator->(), theAffinity);
}
-// ========================================================================
-// function : UnregisterObject
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::UnregisterObject(const Handle(Standard_Transient)& theObject)
{
myRegisteredObjects.UnBind(theObject.operator->());
}
-// ========================================================================
-// function : ObjectAffinity
-// purpose :
-// ========================================================================
+//=================================================================================================
+
const Handle(Graphic3d_ViewAffinity)& Graphic3d_StructureManager::ObjectAffinity(
const Handle(Standard_Transient)& theObject) const
{
return *aResult;
}
-// ========================================================================
-// function : Identification
-// purpose :
-// ========================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_StructureManager::Identification(Graphic3d_CView* theView)
{
if (myDefinedViews.Contains(theView))
return myViewGenId.Next();
}
-// ========================================================================
-// function : UnIdentification
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::UnIdentification(Graphic3d_CView* theView)
{
if (myDefinedViews.Contains(theView))
}
}
-// ========================================================================
-// function : DefinedViews
-// purpose :
-// ========================================================================
+//=================================================================================================
+
const Graphic3d_IndexedMapOfView& Graphic3d_StructureManager::DefinedViews() const
{
return myDefinedViews;
}
-// ========================================================================
-// function : MaxNumOfViews
-// purpose :
-// ========================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_StructureManager::MaxNumOfViews() const
{
return myViewGenId.Upper() - myViewGenId.Lower() + 1;
}
-// ========================================================================
-// function : ReCompute
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::ReCompute(const Handle(Graphic3d_Structure)& theStructure)
{
if (!myDisplayedStructure.Contains(theStructure))
}
}
-// ========================================================================
-// function : ReCompute
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::ReCompute(
const Handle(Graphic3d_Structure)& theStructure,
const Handle(Graphic3d_DataStructureManager)& theProjector)
aView->ReCompute(theStructure);
}
-// ========================================================================
-// function : Clear
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Clear(Graphic3d_Structure* theStructure,
const Standard_Boolean theWithDestruction)
{
}
}
-// ========================================================================
-// function : Connect
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Connect(const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter)
{
}
}
-// ========================================================================
-// function : Disconnect
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Disconnect(const Graphic3d_Structure* theMother,
const Graphic3d_Structure* theDaughter)
{
}
}
-// ========================================================================
-// function : Display
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Display(const Handle(Graphic3d_Structure)& theStructure)
{
myDisplayedStructure.Add(theStructure);
}
}
-// ========================================================================
-// function : Erase
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Erase(const Handle(Graphic3d_Structure)& theStructure)
{
myDisplayedStructure.Remove(theStructure);
}
}
-// ========================================================================
-// function : Erase
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::Highlight(const Handle(Graphic3d_Structure)& theStructure)
{
myHighlightedStructure.Add(theStructure);
}
}
-// ========================================================================
-// function : UnHighlight
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::UnHighlight(const Handle(Graphic3d_Structure)& theStructure)
{
myHighlightedStructure.Remove(theStructure);
}
}
-// ========================================================================
-// function : UnHighlight
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::UnHighlight()
{
for (Graphic3d_MapIteratorOfMapOfStructure anIt(myHighlightedStructure); anIt.More(); anIt.Next())
}
}
-// ========================================================================
-// function : SetTransform
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::SetTransform(const Handle(Graphic3d_Structure)& theStructure,
const Handle(TopLoc_Datum3D)& theTrsf)
{
}
}
-// ========================================================================
-// function : ChangeDisplayPriority
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::ChangeDisplayPriority(
const Handle(Graphic3d_Structure)& theStructure,
const Graphic3d_DisplayPriority theOldPriority,
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_StructureManager::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Text, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Text::Graphic3d_Text(const Standard_ShortReal theHeight)
: myHeight(theHeight),
myHAlign(Graphic3d_HTA_LEFT),
{
}
-// =======================================================================
-// function : SetOrientation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Text::SetOrientation(const gp_Ax2& theOrientation)
{
myOrientation = theOrientation;
myHasPlane = Standard_True;
}
-// =======================================================================
-// function : ResetOrientation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Text::ResetOrientation()
{
myOrientation = gp_Ax2();
static const char* NameOfTexture1d_to_FileName[] = {"1d_elevation.rgb"};
-// =======================================================================
-// function : Graphic3d_Texture1D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1D::Graphic3d_Texture1D(const TCollection_AsciiString& theFileName,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureMap(theFileName, theType),
{
}
-// =======================================================================
-// function : Graphic3d_Texture1D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1D::Graphic3d_Texture1D(const Graphic3d_NameOfTexture1D theNOT,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureMap(NameOfTexture1d_to_FileName[theNOT], theType),
myTexId = TCollection_AsciiString("Graphic3d_Texture1D_") + NameOfTexture1d_to_FileName[theNOT];
}
-// =======================================================================
-// function : Graphic3d_Texture1D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1D::Graphic3d_Texture1D(const Handle(Image_PixMap)& thePixMap,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureMap(thePixMap, theType),
{
}
-// =======================================================================
-// function : Name
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_NameOfTexture1D Graphic3d_Texture1D::Name() const
{
return myName;
}
-// =======================================================================
-// function : NumberOfTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_Texture1D::NumberOfTextures()
{
return sizeof(NameOfTexture1d_to_FileName) / sizeof(char*);
}
-// =======================================================================
-// function : TextureName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_Texture1D::TextureName(const Standard_Integer theRank)
{
if (theRank < 1 || theRank > NumberOfTextures())
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Texture1Dmanual, Graphic3d_Texture1D)
-// =======================================================================
-// function : Graphic3d_Texture1Dmanual
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const TCollection_AsciiString& theFileName)
: Graphic3d_Texture1D(theFileName, Graphic3d_TypeOfTexture_1D)
{
//
}
-// =======================================================================
-// function : Graphic3d_Texture1Dmanual
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const Graphic3d_NameOfTexture1D theNOT)
: Graphic3d_Texture1D(theNOT, Graphic3d_TypeOfTexture_1D)
{
//
}
-// =======================================================================
-// function : Graphic3d_Texture1Dmanual
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1Dmanual::Graphic3d_Texture1Dmanual(const Handle(Image_PixMap)& thePixMap)
: Graphic3d_Texture1D(thePixMap, Graphic3d_TypeOfTexture_1D)
{
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Texture1Dsegment, Graphic3d_Texture1D)
-// =======================================================================
-// function : Graphic3d_Texture1Dsegment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1Dsegment::Graphic3d_Texture1Dsegment(const TCollection_AsciiString& theFileName)
: Graphic3d_Texture1D(theFileName, Graphic3d_TypeOfTexture_1D),
myX1(0.0f),
Graphic3d_Vec4(0.0f, 0.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Graphic3d_Texture1Dsegment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1Dsegment::Graphic3d_Texture1Dsegment(const Graphic3d_NameOfTexture1D theNOT)
: Graphic3d_Texture1D(theNOT, Graphic3d_TypeOfTexture_1D),
myX1(0.0f),
Graphic3d_Vec4(0.0f, 0.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Graphic3d_Texture1Dsegment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture1Dsegment::Graphic3d_Texture1Dsegment(const Handle(Image_PixMap)& thePixMap)
: Graphic3d_Texture1D(thePixMap, Graphic3d_TypeOfTexture_1D),
myX1(0.0f),
Graphic3d_Vec4(0.0f, 0.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : SetSegment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture1Dsegment::SetSegment(const Standard_ShortReal X1,
const Standard_ShortReal Y1,
const Standard_ShortReal Z1,
myParams->SetGenMode(Graphic3d_TOTM_OBJECT, aPlaneX, Graphic3d_Vec4(0.0f, 0.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Segment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture1Dsegment::Segment(Standard_ShortReal& X1,
Standard_ShortReal& Y1,
Standard_ShortReal& Z1,
"2d_rain.rgb",
"2d_chess.rgba"};
-// =======================================================================
-// function : Graphic3d_Texture2D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2D::Graphic3d_Texture2D(const TCollection_AsciiString& theFileName)
: Graphic3d_TextureMap(theFileName, Graphic3d_TypeOfTexture_2D),
myName(Graphic3d_NOT_2D_UNKNOWN)
myParams->SetFilter(Graphic3d_TOTF_TRILINEAR);
}
-// =======================================================================
-// function : Graphic3d_Texture2D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2D::Graphic3d_Texture2D(const TCollection_AsciiString& theFileName,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureMap(theFileName, theType),
//
}
-// =======================================================================
-// function : Graphic3d_Texture2D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2D::Graphic3d_Texture2D(const Graphic3d_NameOfTexture2D theNOT)
: Graphic3d_TextureMap(NameOfTexture2d_to_FileName[theNOT], Graphic3d_TypeOfTexture_2D),
myName(theNOT)
myParams->SetFilter(Graphic3d_TOTF_TRILINEAR);
}
-// =======================================================================
-// function : Graphic3d_Texture2D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2D::Graphic3d_Texture2D(const Graphic3d_NameOfTexture2D theNOT,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureMap(NameOfTexture2d_to_FileName[theNOT], theType),
myTexId = TCollection_AsciiString("Graphic3d_Texture2D_") + NameOfTexture2d_to_FileName[theNOT];
}
-// =======================================================================
-// function : Graphic3d_Texture2D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2D::Graphic3d_Texture2D(const Handle(Image_PixMap)& thePixMap)
: Graphic3d_TextureMap(thePixMap, Graphic3d_TypeOfTexture_2D),
myName(Graphic3d_NOT_2D_UNKNOWN)
myParams->SetFilter(Graphic3d_TOTF_TRILINEAR);
}
-// =======================================================================
-// function : Graphic3d_Texture2D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2D::Graphic3d_Texture2D(const Handle(Image_PixMap)& thePixMap,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureMap(thePixMap, theType),
//
}
-// =======================================================================
-// function : NumberOfTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_Texture2D::NumberOfTextures()
{
return sizeof(NameOfTexture2d_to_FileName) / sizeof(char*);
}
-// =======================================================================
-// function : Name
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_NameOfTexture2D Graphic3d_Texture2D::Name() const
{
return myName;
}
-// =======================================================================
-// function : TextureName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_Texture2D::TextureName(const Standard_Integer theRank)
{
if (theRank < 1 || theRank > NumberOfTextures())
return aFileName.SubString(4, i - 1);
}
-// =======================================================================
-// function : SetImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2D::SetImage(const Handle(Image_PixMap)& thePixMap)
{
myPixMap = thePixMap;
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Texture2Dplane, Graphic3d_Texture2D)
-// =======================================================================
-// function : Graphic3d_Texture2Dplane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2Dplane::Graphic3d_Texture2Dplane(const TCollection_AsciiString& theFileName)
: Graphic3d_Texture2D(theFileName)
{
Graphic3d_Vec4(0.0f, 1.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Graphic3d_Texture2Dplane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2Dplane::Graphic3d_Texture2Dplane(const Graphic3d_NameOfTexture2D theNOT)
: Graphic3d_Texture2D(theNOT)
{
Graphic3d_Vec4(0.0f, 1.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Graphic3d_Texture2Dplane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture2Dplane::Graphic3d_Texture2Dplane(const Handle(Image_PixMap)& thePixMap)
: Graphic3d_Texture2D(thePixMap)
{
Graphic3d_Vec4(0.0f, 1.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : SetPlaneS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetPlaneS(const Standard_ShortReal theA,
const Standard_ShortReal theB,
const Standard_ShortReal theC,
myPlaneName = Graphic3d_NOTP_UNKNOWN;
}
-// =======================================================================
-// function : SetPlaneT
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetPlaneT(const Standard_ShortReal theA,
const Standard_ShortReal theB,
const Standard_ShortReal theC,
myPlaneName = Graphic3d_NOTP_UNKNOWN;
}
-// =======================================================================
-// function : SetPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetPlane(const Graphic3d_NameOfTexturePlane thePlane)
{
switch (thePlane)
myPlaneName = thePlane;
}
-// =======================================================================
-// function : SetScaleS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetScaleS(const Standard_ShortReal theVal)
{
Graphic3d_Vec2 aScale = myParams->Scale();
myParams->SetScale(aScale);
}
-// =======================================================================
-// function : SetScaleT
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetScaleT(const Standard_ShortReal theVal)
{
Graphic3d_Vec2 aScale = myParams->Scale();
myParams->SetScale(aScale);
}
-// =======================================================================
-// function : SetTranslateS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetTranslateS(const Standard_ShortReal theVal)
{
Graphic3d_Vec2 aVec = myParams->Translation();
myParams->SetTranslation(aVec);
}
-// =======================================================================
-// function : SetTranslateT
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetTranslateT(const Standard_ShortReal theVal)
{
Graphic3d_Vec2 aVec = myParams->Translation();
myParams->SetTranslation(aVec);
}
-// =======================================================================
-// function : SetRotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::SetRotation(const Standard_ShortReal theAngleDegrees)
{
myParams->SetRotation(theAngleDegrees);
}
-// =======================================================================
-// function : PlaneS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::PlaneS(Standard_ShortReal& theA,
Standard_ShortReal& theB,
Standard_ShortReal& theC,
theD = aPlaneS.w();
}
-// =======================================================================
-// function : PlaneT
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::PlaneT(Standard_ShortReal& theA,
Standard_ShortReal& theB,
Standard_ShortReal& theC,
theD = aPlaneT.w();
}
-// =======================================================================
-// function : TranslateS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::TranslateS(Standard_ShortReal& theVal) const
{
theVal = myParams->Translation().x();
}
-// =======================================================================
-// function : TranslateT
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::TranslateT(Standard_ShortReal& theVal) const
{
theVal = myParams->Translation().y();
}
-// =======================================================================
-// function : Rotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::Rotation(Standard_ShortReal& theVal) const
{
theVal = myParams->Rotation();
}
-// =======================================================================
-// function : Plane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_NameOfTexturePlane Graphic3d_Texture2Dplane::Plane() const
{
return myPlaneName;
}
-// =======================================================================
-// function : ScaleS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::ScaleS(Standard_ShortReal& theVal) const
{
theVal = myParams->Scale().x();
}
-// =======================================================================
-// function : ScaleT
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture2Dplane::ScaleT(Standard_ShortReal& theVal) const
{
theVal = myParams->Scale().y();
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_Texture3D, Graphic3d_TextureMap)
-// =======================================================================
-// function : Graphic3d_Texture3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture3D::Graphic3d_Texture3D(const TCollection_AsciiString& theFileName)
: Graphic3d_TextureMap(theFileName, Graphic3d_TypeOfTexture_3D)
{
myParams->SetFilter(Graphic3d_TOTF_TRILINEAR);
}
-// =======================================================================
-// function : Graphic3d_Texture3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture3D::Graphic3d_Texture3D(const Handle(Image_PixMap)& thePixMap)
: Graphic3d_TextureMap(thePixMap, Graphic3d_TypeOfTexture_3D)
{
myParams->SetFilter(Graphic3d_TOTF_TRILINEAR);
}
-// =======================================================================
-// function : Graphic3d_Texture3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture3D::Graphic3d_Texture3D(
const NCollection_Array1<TCollection_AsciiString>& theFiles)
: Graphic3d_TextureMap("", Graphic3d_TypeOfTexture_3D)
myPaths.Assign(theFiles);
}
-// =======================================================================
-// function : ~Graphic3d_Texture3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Texture3D::~Graphic3d_Texture3D()
{
//
}
-// =======================================================================
-// function : SetImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Texture3D::SetImage(const Handle(Image_PixMap)& thePixMap)
{
myPixMap = thePixMap;
myPaths.Move(anArr);
}
-// =======================================================================
-// function : GetImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Graphic3d_Texture3D::GetImage(
const Handle(Image_SupportedFormats)& theSupported)
{
"env_lines.rgb",
"env_road.rgb"};
-// =======================================================================
-// function : Graphic3d_TextureEnv
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureEnv::Graphic3d_TextureEnv(const TCollection_AsciiString& theFileName)
: Graphic3d_TextureRoot(theFileName, Graphic3d_TypeOfTexture_2D),
myName(Graphic3d_NOT_ENV_UNKNOWN)
Graphic3d_Vec4(0.0f, 1.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Graphic3d_TextureEnv
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureEnv::Graphic3d_TextureEnv(const Graphic3d_NameOfTextureEnv theNOT)
: Graphic3d_TextureRoot(NameOfTextureEnv_to_FileName[theNOT], Graphic3d_TypeOfTexture_2D),
myName(theNOT)
Graphic3d_Vec4(0.0f, 1.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Graphic3d_TextureEnv
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureEnv::Graphic3d_TextureEnv(const Handle(Image_PixMap)& thePixMap)
: Graphic3d_TextureRoot(thePixMap, Graphic3d_TypeOfTexture_2D),
myName(Graphic3d_NOT_ENV_UNKNOWN)
Graphic3d_Vec4(0.0f, 1.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : Name
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_NameOfTextureEnv Graphic3d_TextureEnv::Name() const
{
return myName;
}
-// =======================================================================
-// function : NumberOfTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Graphic3d_TextureEnv::NumberOfTextures()
{
return sizeof(NameOfTextureEnv_to_FileName) / sizeof(char*);
}
-// =======================================================================
-// function : TextureName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_TextureEnv::TextureName(const Standard_Integer theRank)
{
if (theRank < 1 || theRank > NumberOfTextures())
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_TextureMap, Graphic3d_TextureRoot)
-// =======================================================================
-// function : Graphic3d_TextureMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureMap::Graphic3d_TextureMap(const TCollection_AsciiString& theFileName,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureRoot(theFileName, theType)
{
}
-// =======================================================================
-// function : Graphic3d_TextureMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureMap::Graphic3d_TextureMap(const Handle(Image_PixMap)& thePixMap,
const Graphic3d_TypeOfTexture theType)
: Graphic3d_TextureRoot(thePixMap, theType)
{
}
-// =======================================================================
-// function : EnableSmooth
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureMap::EnableSmooth()
{
myParams->SetFilter(Graphic3d_TOTF_TRILINEAR);
}
-// =======================================================================
-// function : DisableSmooth
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureMap::DisableSmooth()
{
myParams->SetFilter(Graphic3d_TOTF_NEAREST);
}
-// =======================================================================
-// function : IsSmoothed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_TextureMap::IsSmoothed() const
{
return myParams->Filter() != Graphic3d_TOTF_NEAREST;
}
-// =======================================================================
-// function : EnableModulate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureMap::EnableModulate()
{
myParams->SetModulate(Standard_True);
}
-// =======================================================================
-// function : DisableModulate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureMap::DisableModulate()
{
myParams->SetModulate(Standard_False);
}
-// =======================================================================
-// function : IsModulate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_TextureMap::IsModulate() const
{
return myParams->IsModulate();
}
-// =======================================================================
-// function : EnableRepeat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureMap::EnableRepeat()
{
myParams->SetRepeat(Standard_True);
}
-// =======================================================================
-// function : DisableRepeat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureMap::DisableRepeat()
{
myParams->SetRepeat(Standard_False);
}
-// =======================================================================
-// function : IsRepeat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_TextureMap::IsRepeat() const
{
return myParams->IsRepeat();
}
-// =======================================================================
-// function : AnisoFilter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_LevelOfTextureAnisotropy Graphic3d_TextureMap::AnisoFilter() const
{
return myParams->AnisoFilter();
}
-// =======================================================================
-// function : SetAnisoFilter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureMap::SetAnisoFilter(const Graphic3d_LevelOfTextureAnisotropy theLevel)
{
myParams->SetAnisoFilter(theLevel);
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_TextureParams, Standard_Transient)
-// =======================================================================
-// function : Graphic3d_TextureParams
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureParams::Graphic3d_TextureParams()
: myGenPlaneS(0.0f, 0.0f, 0.0f, 0.0f),
myGenPlaneT(0.0f, 0.0f, 0.0f, 0.0f),
//
}
-// =======================================================================
-// function : ~Graphic3d_TextureParams
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureParams::~Graphic3d_TextureParams()
{
//
}
-// =======================================================================
-// function : SetModulate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetModulate(const Standard_Boolean theToModulate)
{
myToModulate = theToModulate;
}
-// =======================================================================
-// function : SetRepeat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetRepeat(const Standard_Boolean theToRepeat)
{
if (myToRepeat != theToRepeat)
}
}
-// =======================================================================
-// function : SetFilter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetFilter(const Graphic3d_TypeOfTextureFilter theFilter)
{
if (myFilter != theFilter)
}
}
-// =======================================================================
-// function : SetAnisoFilter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetAnisoFilter(const Graphic3d_LevelOfTextureAnisotropy theLevel)
{
if (myAnisoLevel != theLevel)
}
}
-// =======================================================================
-// function : SetRotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetRotation(const Standard_ShortReal theAngleDegrees)
{
myRotAngle = theAngleDegrees;
}
-// =======================================================================
-// function : SetScale
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetScale(const Graphic3d_Vec2 theScale)
{
myScale = theScale;
}
-// =======================================================================
-// function : SetTranslation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetTranslation(const Graphic3d_Vec2 theVec)
{
myTranslation = theVec;
}
-// =======================================================================
-// function : SetGenMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureParams::SetGenMode(const Graphic3d_TypeOfTextureMode theMode,
const Graphic3d_Vec4 thePlaneS,
const Graphic3d_Vec4 thePlaneT)
static volatile Standard_Integer THE_TEXTURE_COUNTER = 0;
}
-// =======================================================================
-// function : TexturesFolder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Graphic3d_TextureRoot::TexturesFolder()
{
static Standard_Boolean IsDefined = Standard_False;
return VarName;
}
-// =======================================================================
-// function : Graphic3d_TextureRoot
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureRoot::Graphic3d_TextureRoot(const TCollection_AsciiString& theFileName,
const Graphic3d_TypeOfTexture theType)
: myParams(new Graphic3d_TextureParams()),
generateId();
}
-// =======================================================================
-// function : Graphic3d_TextureRoot
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureRoot::Graphic3d_TextureRoot(const Handle(Image_PixMap)& thePixMap,
const Graphic3d_TypeOfTexture theType)
: myParams(new Graphic3d_TextureParams()),
generateId();
}
-// =======================================================================
-// function : ~Graphic3d_TextureRoot
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TextureRoot::~Graphic3d_TextureRoot()
{
//
}
-// =======================================================================
-// function : generateId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureRoot::generateId()
{
myTexId = TCollection_AsciiString("Graphic3d_TextureRoot_")
+ TCollection_AsciiString(Standard_Atomic_Increment(&THE_TEXTURE_COUNTER));
}
-// =======================================================================
-// function : GetCompressedImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_CompressedPixMap) Graphic3d_TextureRoot::GetCompressedImage(
const Handle(Image_SupportedFormats)& theSupported)
{
return Handle(Image_CompressedPixMap)();
}
-// =======================================================================
-// function : GetImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Graphic3d_TextureRoot::GetImage(
const Handle(Image_SupportedFormats)& theSupported)
{
return Handle(Image_PixMap)();
}
-// =======================================================================
-// function : convertToCompatible
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TextureRoot::convertToCompatible(const Handle(Image_SupportedFormats)& theSupported,
const Handle(Image_PixMap)& theImage)
{
}
}
-// =======================================================================
-// function : IsDone
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Graphic3d_TextureRoot::IsDone() const
{
// Case 1: texture source is specified as pixmap
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_TransformPers, Standard_Transient)
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TransformPers::PersParams3d::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &anAttachPoint)
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TransformPers::PersParams2d::DumpJson(Standard_OStream& theOStream,
Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Corner)
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_TransformPers::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_TransformPersScaledAbove, Graphic3d_TransformPers)
-// =======================================================================
-// function : Graphic3d_TransformPersScaledAbove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_TransformPersScaledAbove::Graphic3d_TransformPersScaledAbove(const Standard_Real theScale,
const gp_Pnt& thePnt)
: Graphic3d_TransformPers(Graphic3d_TMF_ZoomPers, thePnt),
{
}
-// =======================================================================
-// function : persistentScale
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Graphic3d_TransformPersScaledAbove::persistentScale(
const Handle(Graphic3d_Camera)& theCamera,
const Standard_Integer theViewportWidth,
+ (Z() - AOther.Z()) * (Z() - AOther.Z()));
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_Vertex::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
gp_XYZ aCoord(xyz[0], xyz[1], xyz[2]);
IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_ViewAffinity, Standard_Transient)
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Graphic3d_ViewAffinity::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(IVtk_IShapeMesher, IVtk_Interface)
-// ================================================================
-// Function : initialize
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void IVtk_IShapeMesher::initialize(const IVtk_IShape::Handle& theShape,
const IVtk_IShapeData::Handle& theData)
{
myShapeData = theData;
}
-// ================================================================
-// Function : Build
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void IVtk_IShapeMesher::Build(const IVtk_IShape::Handle& theShape,
const IVtk_IShapeData::Handle& theData)
{
vtkStandardNewMacro(IVtkDraw_Interactor)
- //===========================================================
- // Function : Constructor
- // Purpose :
- //===========================================================
+ //=================================================================================================
+
IVtkDraw_Interactor::IVtkDraw_Interactor()
:
#ifdef _WIN32
vtkStandardNewMacro(IVtkTools_ShapeDataSource)
- //================================================================
- // Function : Constructor
- // Purpose :
- //================================================================
+ //=================================================================================================
+
IVtkTools_ShapeDataSource::IVtkTools_ShapeDataSource()
: myPolyData(new IVtkVTK_ShapeData()),
myIsFastTransformMode(Standard_False),
vtkStandardNewMacro(IVtkTools_SubPolyDataFilter)
- //================================================================
- // Function : Constructor
- // Purpose :
- //================================================================
+ //=================================================================================================
+
IVtkTools_SubPolyDataFilter::IVtkTools_SubPolyDataFilter()
: myIdsArrayName(IVtkVTK_ShapeData::ARRNAME_SUBSHAPE_IDS()),
myDoFiltering(true),
#endif
} // namespace
-// =======================================================================
-// function : Image_AlienPixMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_AlienPixMap::Image_AlienPixMap()
#ifdef HAVE_WINCODEC
: myPalette(NULL)
SetTopDown(false);
}
-// =======================================================================
-// function : ~Image_AlienPixMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_AlienPixMap::~Image_AlienPixMap()
{
Clear();
}
-// =======================================================================
-// function : InitWrapper
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_AlienPixMap::InitWrapper(Image_Format,
Standard_Byte*,
const Standard_Size,
return false;
}
-// =======================================================================
-// function : InitTrash
-// purpose :
-// =======================================================================
+//=================================================================================================
+
#ifdef HAVE_FREEIMAGE
bool Image_AlienPixMap::InitTrash(Image_Format thePixelFormat,
const Standard_Size theSizeX,
}
#endif
-// =======================================================================
-// function : InitCopy
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_AlienPixMap::InitCopy(const Image_PixMap& theCopy)
{
if (&theCopy == this)
return false;
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Image_AlienPixMap::Clear()
{
Image_PixMap::Clear();
#endif
}
-// =======================================================================
-// function : IsTopDownDefault
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_AlienPixMap::IsTopDownDefault()
{
#ifdef HAVE_FREEIMAGE
#endif
}
-// =======================================================================
-// function : Load
-// purpose :
-// =======================================================================
+//=================================================================================================
+
#ifdef HAVE_FREEIMAGE
bool Image_AlienPixMap::Load(const Standard_Byte* theData,
const Standard_Size theLength,
}
#endif
-// =======================================================================
-// function : savePPM
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_AlienPixMap::savePPM(const TCollection_AsciiString& theFileName) const
{
if (IsEmpty())
return true;
}
-// =======================================================================
-// function : convertData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
#ifdef HAVE_WINCODEC
static bool convertData(const Image_AlienPixMap& theSrcPixMapData,
const WICPixelFormatGUID& theFormat,
}
#endif
-// =======================================================================
-// function : Save
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_AlienPixMap::Save(Standard_Byte* theBuffer,
const Standard_Size theLength,
const TCollection_AsciiString& theFileName)
#endif
}
-// =======================================================================
-// function : AdjustGamma
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_AlienPixMap::AdjustGamma(const Standard_Real theGammaCorr)
{
#ifdef HAVE_FREEIMAGE
}
#ifdef HAVE_FREEIMAGE
-// =======================================================================
-// function : GetImageToDump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
FIBITMAP* Image_AlienPixMap::getImageToDump(const Standard_Integer theFormat)
{
FIBITMAP* anImageToDump = myLibImage;
uint32_t Reserved2;
};
-// =======================================================================
-// function : Load
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_CompressedPixMap) Image_DDSParser::Load(
const Handle(Image_SupportedFormats)& theSupported,
const TCollection_AsciiString& theFile,
return aDef;
}
-// =======================================================================
-// function : Load
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_CompressedPixMap) Image_DDSParser::Load(
const Handle(Image_SupportedFormats)& theSupported,
const Handle(NCollection_Buffer)& theBuffer,
return aDef;
}
-// =======================================================================
-// function : parseHeader
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Image_CompressedPixMap) Image_DDSParser::parseHeader(const DDSFileHeader& theHeader)
{
if (theHeader.Size != 124 || theHeader.Width == 0 || theHeader.Height == 0
} // namespace
-// =======================================================================
-// function : Image_Diff
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_Diff::Image_Diff()
: myColorTolerance(0.0),
myIsBorderFilterOn(Standard_False)
//
}
-// =======================================================================
-// function : ~Image_Diff
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_Diff::~Image_Diff()
{
releaseGroupsOfDiffPixels();
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Image_Diff::Init(const Handle(Image_PixMap)& theImageRef,
const Handle(Image_PixMap)& theImageNew,
const Standard_Boolean theToBlackWhite)
return Standard_True;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Image_Diff::Init(const TCollection_AsciiString& theImgPathRef,
const TCollection_AsciiString& theImgPathNew,
const Standard_Boolean theToBlackWhite)
return Init(anImgRef, anImgNew, theToBlackWhite);
}
-// =======================================================================
-// function : Compare
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Image_Diff::Compare()
{
// Number of different pixels (by color)
return aNbDiffColors;
}
-// =======================================================================
-// function : SaveDiffImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Image_Diff::SaveDiffImage(Image_PixMap& theDiffImage) const
{
if (myImageRef.IsNull() || myImageNew.IsNull())
return Standard_True;
}
-// =======================================================================
-// function : SaveDiffImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Image_Diff::SaveDiffImage(const TCollection_AsciiString& theDiffPath) const
{
if (myImageRef.IsNull() || myImageNew.IsNull() || theDiffPath.IsEmpty())
return aDiff.Save(theDiffPath);
}
-// =======================================================================
-// function : ignoreBorderEffect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Image_Diff::ignoreBorderEffect()
{
if (myImageRef.IsNull() || myImageNew.IsNull())
return aNbDiffColors;
}
-// =======================================================================
-// function : releaseGroupsOfDiffPixels
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Image_Diff::releaseGroupsOfDiffPixels()
{
myGroupsOfDiffPixels.Clear();
IMPLEMENT_STANDARD_RTTIEXT(Image_PixMapData, NCollection_Buffer)
IMPLEMENT_STANDARD_RTTIEXT(Image_PixMap, Standard_Transient)
-// =======================================================================
-// function : DefaultAllocator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(NCollection_BaseAllocator)& Image_PixMap::DefaultAllocator()
{
static const Handle(NCollection_BaseAllocator) THE_ALLOC = new NCollection_AlignedAllocator(16);
return THE_ALLOC;
}
-// =======================================================================
-// function : ImageFormatToString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CString Image_PixMap::ImageFormatToString(Image_Format theFormat)
{
return Image_Table_ImageFormats[theFormat].Name;
}
-// =======================================================================
-// function : ImageFormatToString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CString Image_PixMap::ImageFormatToString(Image_CompressedFormat theFormat)
{
return Image_Table_ImageFormats[theFormat].Name;
}
-// =======================================================================
-// function : Image_PixMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_PixMap::Image_PixMap()
: myImgFormat(Image_Format_Gray)
{
//
}
-// =======================================================================
-// function : ~Image_PixMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_PixMap::~Image_PixMap()
{
Clear();
}
-// =======================================================================
-// function : SizePixelBytes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size Image_PixMap::SizePixelBytes(const Image_Format thePixelFormat)
{
return Image_Table_ImageFormats[thePixelFormat].PixelSize;
}
-// =======================================================================
-// function : SetFormat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Image_PixMap::SetFormat(Image_Format thePixelFormat)
{
if (myImgFormat == thePixelFormat)
myImgFormat = thePixelFormat;
}
-// =======================================================================
-// function : InitWrapper3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::InitWrapper3D(Image_Format thePixelFormat,
Standard_Byte* theDataPtr,
const NCollection_Vec3<Standard_Size>& theSizeXYZ,
return true;
}
-// =======================================================================
-// function : InitWrapper
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::InitWrapper(Image_Format thePixelFormat,
Standard_Byte* theDataPtr,
const Standard_Size theSizeX,
theSizeRowBytes);
}
-// =======================================================================
-// function : InitTrash3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::InitTrash3D(Image_Format thePixelFormat,
const NCollection_Vec3<Standard_Size>& theSizeXYZ,
const Standard_Size theSizeRowBytes)
return !myData.IsEmpty();
}
-// =======================================================================
-// function : InitTrash
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::InitTrash(Image_Format thePixelFormat,
const Standard_Size theSizeX,
const Standard_Size theSizeY,
theSizeRowBytes);
}
-// =======================================================================
-// function : InitZero3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::InitZero3D(Image_Format thePixelFormat,
const NCollection_Vec3<Standard_Size>& theSizeXYZ,
const Standard_Size theSizeRowBytes,
return true;
}
-// =======================================================================
-// function : InitCopy
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::InitCopy(const Image_PixMap& theCopy)
{
if (&theCopy == this)
return true;
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Image_PixMap::Clear()
{
Handle(NCollection_BaseAllocator) anEmptyAlloc;
nullptr);
}
-// =======================================================================
-// function : ColorFromRawPixel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Quantity_ColorRGBA Image_PixMap::ColorFromRawPixel(const Standard_Byte* theRawValue,
const Image_Format theFormat,
const Standard_Boolean theToLinearize)
return Quantity_ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f); // transparent
}
-// =======================================================================
-// function : ColorToRawPixel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Image_PixMap::ColorToRawPixel(Standard_Byte* theRawValue,
const Image_Format theFormat,
const Quantity_ColorRGBA& theColor,
}
}
-// =======================================================================
-// function : SwapRgbaBgra
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::SwapRgbaBgra(Image_PixMap& theImage)
{
switch (theImage.Format())
}
}
-// =======================================================================
-// function : ToBlackWhite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Image_PixMap::ToBlackWhite(Image_PixMap& theImage)
{
switch (theImage.Format())
}
}
-// =======================================================================
-// function : FlipY
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Image_PixMap::FlipY(Image_PixMap& theImage)
{
if (theImage.IsEmpty() || theImage.SizeX() == 0 || theImage.SizeY() == 0)
IMPLEMENT_STANDARD_RTTIEXT(Image_SupportedFormats, Standard_Transient)
-// =======================================================================
-// function : Image_SupportedFormats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_SupportedFormats::Image_SupportedFormats()
: myFormats(Image_Format_UNKNOWN, Image_CompressedFormat_NB - 1),
myHasCompressed(false)
IMPLEMENT_STANDARD_RTTIEXT(Image_Texture, Standard_Transient)
-// ================================================================
-// Function : Image_Texture
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Image_Texture::Image_Texture(const TCollection_AsciiString& theFileName)
: myImagePath(theFileName),
myOffset(-1),
}
}
-// ================================================================
-// Function : Image_Texture
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Image_Texture::Image_Texture(const TCollection_AsciiString& theFileName,
int64_t theOffset,
int64_t theLength)
}
}
-// ================================================================
-// Function : Image_Texture
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Image_Texture::Image_Texture(const Handle(NCollection_Buffer)& theBuffer,
const TCollection_AsciiString& theId)
: myBuffer(theBuffer),
}
}
-// ================================================================
-// Function : ReadCompressedImage
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Handle(Image_CompressedPixMap) Image_Texture::ReadCompressedImage(
const Handle(Image_SupportedFormats)& theSupported) const
{
return Image_DDSParser::Load(theSupported, myImagePath, 0);
}
-// ================================================================
-// Function : ReadImage
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Image_Texture::ReadImage(const Handle(Image_SupportedFormats)&) const
{
Handle(Image_PixMap) anImage;
return anImage;
}
-// ================================================================
-// Function : loadImageFile
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Image_Texture::loadImageFile(const TCollection_AsciiString& thePath) const
{
Handle(Image_AlienPixMap) anImage = new Image_AlienPixMap();
return anImage;
}
-// ================================================================
-// Function : loadImageBuffer
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Image_Texture::loadImageBuffer(const Handle(NCollection_Buffer)& theBuffer,
const TCollection_AsciiString& theId) const
{
return anImage;
}
-// ================================================================
-// Function : loadImageOffset
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Handle(Image_PixMap) Image_Texture::loadImageOffset(const TCollection_AsciiString& thePath,
int64_t theOffset,
int64_t theLength) const
return anImage;
}
-// ================================================================
-// Function : MimeType
-// Purpose :
-// ================================================================
+//=================================================================================================
+
TCollection_AsciiString Image_Texture::MimeType() const
{
const TCollection_AsciiString aType = ProbeImageFileFormat();
return TCollection_AsciiString();
}
-// ================================================================
-// Function : ProbeImageFileFormat
-// Purpose :
-// ================================================================
+//=================================================================================================
+
TCollection_AsciiString Image_Texture::ProbeImageFileFormat() const
{
static const Standard_Size THE_PROBE_SIZE = 20;
return "";
}
-// ================================================================
-// Function : WriteImage
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Standard_Boolean Image_Texture::WriteImage(const TCollection_AsciiString& theFile)
{
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
return true;
}
-// ================================================================
-// Function : WriteImage
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Standard_Boolean Image_Texture::WriteImage(std::ostream& theStream,
const TCollection_AsciiString& theFile)
{
Standard_Boolean& bAllowSamplingU,
Standard_Boolean& bAllowSamplingV);
-// ==================================================================================
-// function: IntTools_BeanFaceIntersector
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector()
: myFirstParameter(0.),
myLastParameter(0.),
myCurveResolution = Precision::PConfusion();
}
-// ==================================================================================
-// function: IntTools_BeanFaceIntersector
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const TopoDS_Edge& theEdge,
const TopoDS_Face& theFace)
: myFirstParameter(0.),
Init(theEdge, theFace);
}
-// ==================================================================================
-// function: IntTools_BeanFaceIntersector
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Curve& theCurve,
const BRepAdaptor_Surface& theSurface,
const Standard_Real theBeanTolerance,
Init(theCurve, theSurface, theBeanTolerance, theFaceTolerance);
}
-// ==================================================================================
-// function: IntTools_BeanFaceIntersector
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Curve& theCurve,
const BRepAdaptor_Surface& theSurface,
const Standard_Real theFirstParOnCurve,
Handle(Geom_Surface)::DownCast(mySurface.Surface().Surface()->Transformed(mySurface.Trsf()));
}
-// ==================================================================================
-// function: Init
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::Init(const TopoDS_Edge& theEdge, const TopoDS_Face& theFace)
{
if (myContext.IsNull())
myResults.Clear();
}
-// ==================================================================================
-// function: Init
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::Init(const BRepAdaptor_Curve& theCurve,
const BRepAdaptor_Surface& theSurface,
const Standard_Real theBeanTolerance,
myResults.Clear();
}
-// ==================================================================================
-// function: Init
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::Init(const BRepAdaptor_Curve& theCurve,
const BRepAdaptor_Surface& theSurface,
const Standard_Real theFirstParOnCurve,
SetSurfaceParameters(theUMinParameter, theUMaxParameter, theVMinParameter, theVMaxParameter);
}
-// ==================================================================================
-// function: SetContext
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::SetContext(const Handle(IntTools_Context)& theContext)
{
myContext = theContext;
}
-// ==================================================================================
-// function: Context
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
const Handle(IntTools_Context)& IntTools_BeanFaceIntersector::Context() const
{
return myContext;
}
-// ==================================================================================
-// function: SetBeanParameters
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::SetBeanParameters(const Standard_Real theFirstParOnCurve,
const Standard_Real theLastParOnCurve)
{
myLastParameter = theLastParOnCurve;
}
-// ==================================================================================
-// function: SetSurfaceParameters
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::SetSurfaceParameters(const Standard_Real theUMinParameter,
const Standard_Real theUMaxParameter,
const Standard_Real theVMinParameter,
myVMaxParameter = theVMaxParameter;
}
-// ==================================================================================
-// function: Perform
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::Perform()
{
myIsDone = Standard_False;
}
}
-// ==================================================================================
-// function: Result
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
const IntTools_SequenceOfRanges& IntTools_BeanFaceIntersector::Result() const
{
return myResults;
}
-// ==================================================================================
-// function: Result
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::Result(IntTools_SequenceOfRanges& theResults) const
{
theResults = myResults;
}
-// ==================================================================================
-// function: Distance
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
Standard_Real IntTools_BeanFaceIntersector::Distance(const Standard_Real theArg)
{
gp_Pnt aPoint = myCurve.Value(theArg);
return aDistance;
}
-// ==================================================================================
-// function: Distance
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
Standard_Real IntTools_BeanFaceIntersector::Distance(const Standard_Real theArg,
Standard_Real& theUParameter,
Standard_Real& theVParameter)
return aDistance;
}
-// ==================================================================================
-// function: ComputeAroundExactIntersection
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection()
{
IntCurveSurface_HInter anExactIntersector;
}
}
-// ==================================================================================
-// function: FastComputeExactIntersection
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
Standard_Boolean IntTools_BeanFaceIntersector::FastComputeAnalytic()
{
GeomAbs_CurveType aCT = myCurve.GetType();
return isCoincide || !hasIntersection;
}
-// ==================================================================================
-// function: ComputeLinePlane
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::ComputeLinePlane()
{
Standard_Real Tolang = 1.e-9;
return;
}
-// ==================================================================================
-// function: ComputeUsingExtremum
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::ComputeUsingExtremum()
{
Standard_Real Tol, af, al;
}
}
-// ==================================================================================
-// function: ComputeNearRangeBoundaries
-// purpose:
-// ==================================================================================
+//=================================================================================================
+
void IntTools_BeanFaceIntersector::ComputeNearRangeBoundaries()
{
Standard_Real U = myUMinParameter;
// return close;
// }
-// ======================================================================================================================
-// function: LocalizeSolutions
-// purpose:
-// ======================================================================================================================
+//=================================================================================================
+
Standard_Boolean IntTools_BeanFaceIntersector::LocalizeSolutions(
const IntTools_CurveRangeSample& theCurveRange,
const Bnd_Box& theBoxCurve,
return Standard_True;
}
-// ======================================================================================================================
-// function: ComputeLocalized
-// purpose:
-// ======================================================================================================================
+//=================================================================================================
+
Standard_Boolean IntTools_BeanFaceIntersector::ComputeLocalized()
{
Standard_Real Tol = Precision::PConfusion();
return Standard_True;
}
-// ======================================================================================================================
-// function: TestComputeCoinside
-// purpose:
-// ======================================================================================================================
+//=================================================================================================
+
Standard_Boolean IntTools_BeanFaceIntersector::TestComputeCoinside()
{
Standard_Real cfp = myFirstParameter, clp = myLastParameter;
Standard_Integer& theNbSamplesU,
Standard_Integer& theNbSamplesV);
-// =====================================================================================
-// function: Constructor
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
IntTools_TopolTool::IntTools_TopolTool()
{
myNbSmplU = 0;
myDV = 1.;
}
-// =====================================================================================
-// function: Constructor
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
IntTools_TopolTool::IntTools_TopolTool(const Handle(Adaptor3d_Surface)& theSurface)
{
Initialize(theSurface);
myDV = 1.;
}
-// =====================================================================================
-// function: Initialize
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
void IntTools_TopolTool::Initialize()
{
throw Standard_NotImplemented("IntTools_TopolTool::Initialize ()");
}
-// =====================================================================================
-// function: Initialize
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
void IntTools_TopolTool::Initialize(const Handle(Adaptor3d_Surface)& theSurface)
{
Adaptor3d_TopolTool::Initialize(theSurface);
myDV = 1.;
}
-// =====================================================================================
-// function: ComputeSamplePoints
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
void IntTools_TopolTool::ComputeSamplePoints()
{
Standard_Real uinf, usup, vinf, vsup;
myDV = (vsup - vinf) / (myNbSmplV + 1);
}
-// =====================================================================================
-// function: NbSamplesU
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
Standard_Integer IntTools_TopolTool::NbSamplesU()
{
if (myNbSmplU <= 0)
return myNbSmplU;
}
-// =====================================================================================
-// function: NbSamplesV
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
Standard_Integer IntTools_TopolTool::NbSamplesV()
{
if (myNbSmplV <= 0)
return myNbSmplV;
}
-// =====================================================================================
-// function: NbSamples
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
Standard_Integer IntTools_TopolTool::NbSamples()
{
if (myNbSmplU <= 0)
return (myNbSmplU * myNbSmplV);
}
-// =====================================================================================
-// function: SamplePoint
-// purpose:
-// =====================================================================================
+//=================================================================================================
+
void IntTools_TopolTool::SamplePoint(const Standard_Integer Index, gp_Pnt2d& P2d, gp_Pnt& P3d)
{
if (myUPars.IsNull())
IMPLEMENT_STANDARD_RTTIEXT(Media_BufferPool, Standard_Transient)
-// =======================================================================
-// function : Media_BufferPool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_BufferPool::Media_BufferPool()
: myPool(NULL),
myBufferSize(0)
//
}
-// =======================================================================
-// function : ~Media_BufferPool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_BufferPool::~Media_BufferPool()
{
Release();
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_BufferPool::Release()
{
if (myPool != NULL)
}
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_BufferPool::Init(int theBufferSize)
{
if (myBufferSize == theBufferSize)
return myPool != NULL;
}
-// =======================================================================
-// function : GetBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
AVBufferRef* Media_BufferPool::GetBuffer()
{
#ifdef HAVE_FFMPEG
IMPLEMENT_STANDARD_RTTIEXT(Media_CodecContext, Standard_Transient)
-// =======================================================================
-// function : Media_CodecContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_CodecContext::Media_CodecContext()
: myCodecCtx(NULL),
myCodec(NULL),
#endif
}
-// =======================================================================
-// function : ~Media_CodecContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_CodecContext::~Media_CodecContext()
{
Close();
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_CodecContext::Init(const AVStream& theStream, double thePtsStartBase, int theNbThreads)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_CodecContext::Init(const AVStream& theStream,
double thePtsStartBase,
int theNbThreads,
#endif
}
-// =======================================================================
-// function : Close
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_CodecContext::Close()
{
if (myCodecCtx != NULL)
}
}
-// =======================================================================
-// function : Flush
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_CodecContext::Flush()
{
if (myCodecCtx != NULL)
}
}
-// =======================================================================
-// function : SizeX
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_CodecContext::SizeX() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : SizeY
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_CodecContext::SizeY() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : CanProcessPacket
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_CodecContext::CanProcessPacket(const Handle(Media_Packet)& thePacket) const
{
return !thePacket.IsNull() && myStreamIndex == thePacket->StreamIndex();
}
-// =======================================================================
-// function : SendPacket
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_CodecContext::SendPacket(const Handle(Media_Packet)& thePacket)
{
if (!CanProcessPacket(thePacket))
#endif
}
-// =======================================================================
-// function : ReceiveFrame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_CodecContext::ReceiveFrame(const Handle(Media_Frame)& theFrame)
{
if (theFrame.IsNull())
#endif
} // namespace
-// =======================================================================
-// function : FormatAVErrorDescription
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Media_FormatContext::FormatAVErrorDescription(int theErrCodeAV)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : FormatUnitsToSeconds
-// purpose :
-// =======================================================================
+//=================================================================================================
+
double Media_FormatContext::FormatUnitsToSeconds(int64_t theTimeUnits)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : UnitsToSeconds
-// purpose :
-// =======================================================================
+//=================================================================================================
+
double Media_FormatContext::UnitsToSeconds(const AVRational& theTimeBase, int64_t theTimeUnits)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : StreamUnitsToSeconds
-// purpose :
-// =======================================================================
+//=================================================================================================
+
double Media_FormatContext::StreamUnitsToSeconds(const AVStream& theStream, int64_t theTimeUnits)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : SecondsToUnits
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int64_t Media_FormatContext::SecondsToUnits(double theTimeSeconds)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : SecondsToUnits
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int64_t Media_FormatContext::SecondsToUnits(const AVRational& theTimeBase, double theTimeSeconds)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Media_FormatContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int64_t Media_FormatContext::StreamSecondsToUnits(const AVStream& theStream, double theTimeSeconds)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Media_FormatContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_FormatContext::Media_FormatContext()
: myFormatCtx(NULL),
myPtsStartBase(0.0),
//
}
-// =======================================================================
-// function : ~Media_FormatContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_FormatContext::~Media_FormatContext()
{
Close();
}
-// =======================================================================
-// function : NbSteams
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int Media_FormatContext::NbSteams() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Stream
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const AVStream& Media_FormatContext::Stream(unsigned int theIndex) const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : OpenInput
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_FormatContext::OpenInput(const TCollection_AsciiString& theInput)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Close
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_FormatContext::Close()
{
if (myFormatCtx != NULL)
}
}
-// =======================================================================
-// function : FormatTime
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Media_FormatContext::FormatTime(double theSeconds)
{
double aSecIn = theSeconds;
return TCollection_AsciiString(aMilliSeconds) + " ms";
}
-// =======================================================================
-// function : FormatTimeProgress
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Media_FormatContext::FormatTimeProgress(double theProgress,
double theDuration)
{
return aBuffer;
}
-// =======================================================================
-// function : StreamInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Media_FormatContext::StreamInfo(unsigned int theIndex,
AVCodecContext* theCodecCtx) const
{
#endif
}
-// =======================================================================
-// function : ReadPacket
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_FormatContext::ReadPacket(const Handle(Media_Packet)& thePacket)
{
if (thePacket.IsNull())
#endif
}
-// =======================================================================
-// function : SeekStream
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_FormatContext::SeekStream(unsigned int theStreamId,
double theSeekPts,
bool theToSeekBack)
#endif
}
-// =======================================================================
-// function : Seek
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_FormatContext::Seek(double theSeekPts, bool theToSeekBack)
{
#ifdef HAVE_FFMPEG
IMPLEMENT_STANDARD_RTTIEXT(Media_Frame, Standard_Transient)
-// =======================================================================
-// function : FormatFFmpeg2Occt
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Image_Format Media_Frame::FormatFFmpeg2Occt(int theFormat)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : FormatOcct2FFmpeg
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_Frame::FormatOcct2FFmpeg(Image_Format theFormat)
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Media_Frame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_Frame::Media_Frame()
: myFrame(NULL),
myFramePts(0.0),
Unref();
}
-// =======================================================================
-// function : ~Media_Frame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_Frame::~Media_Frame()
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Unref
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_Frame::Unref()
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : IsFullRangeYUV
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_Frame::IsFullRangeYUV() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Swap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_Frame::Swap(const Handle(Media_Frame)& theFrame1, const Handle(Media_Frame)& theFrame2)
{
std::swap(theFrame1->myFrame, theFrame2->myFrame);
}
-// =======================================================================
-// function : IsEmpty
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_Frame::IsEmpty() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : SizeX
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_Frame::SizeX() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : SizeY
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_Frame::SizeY() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Format
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_Frame::Format() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Plane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
uint8_t* Media_Frame::Plane(int thePlaneId) const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : LineSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_Frame::LineSize(int thePlaneId) const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : BestEffortTimestamp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int64_t Media_Frame::BestEffortTimestamp() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : InitWrapper
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_Frame::InitWrapper(const Handle(Image_PixMap)& thePixMap)
{
Unref();
IMPLEMENT_STANDARD_RTTIEXT(Media_Packet, Standard_Transient)
-// =======================================================================
-// function : Media_Packet
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_Packet::Media_Packet()
: myPacket(NULL)
{
#endif
}
-// =======================================================================
-// function : ~Media_Packet
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_Packet::~Media_Packet()
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Unref
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_Packet::Unref()
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Data
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const uint8_t* Media_Packet::Data() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : ChangeData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
uint8_t* Media_Packet::ChangeData()
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_Packet::Size() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Pts
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int64_t Media_Packet::Pts() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Dts
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int64_t Media_Packet::Dts() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : Duration
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int64_t Media_Packet::Duration() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : StreamIndex
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int Media_Packet::StreamIndex() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : IsKeyFrame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_Packet::IsKeyFrame() const
{
#ifdef HAVE_FFMPEG
#endif
}
-// =======================================================================
-// function : SetKeyFrame
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_Packet::SetKeyFrame()
{
#ifdef HAVE_FFMPEG
IMPLEMENT_STANDARD_RTTIEXT(Media_Scaler, Standard_Transient)
-// =======================================================================
-// function : Media_Scaler
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_Scaler::Media_Scaler()
: mySwsContext(NULL),
mySrcFormat(0),
#endif
}
-// =======================================================================
-// function : ~Media_Scaler
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Media_Scaler::~Media_Scaler()
{
Release();
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Media_Scaler::Release()
{
if (mySwsContext != NULL)
}
}
-// =======================================================================
-// function : Convert
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_Scaler::Init(const Graphic3d_Vec2i& theSrcDims,
int theSrcFormat,
const Graphic3d_Vec2i& theResDims,
#endif
}
-// =======================================================================
-// function : Convert
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Media_Scaler::Convert(const Handle(Media_Frame)& theSrc, const Handle(Media_Frame)& theRes)
{
if (theSrc.IsNull() || theSrc->IsEmpty() || theRes.IsNull() || theRes->IsEmpty()
return Standard_False;
}
-// =======================================================================
-// function : ToOSDMetric
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Message::ToOSDMetric(const Message_MetricType theMetric,
OSD_MemInfo::Counter& theMemInfo)
{
return Standard_True;
}
-// =======================================================================
-// function : ToMessageMetric
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Message::ToMessageMetric(const OSD_MemInfo::Counter theMemInfo,
Message_MetricType& theMetric)
{
const OSD_WhoAmI Iam = OSD_WDirectory;
#endif
-// =======================================================================
-// function : OSD_Directory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Directory::OSD_Directory()
{
//
}
-// =======================================================================
-// function : OSD_Directory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Directory::OSD_Directory(const OSD_Path& theName)
: OSD_FileNode(theName)
{
//
}
-// =======================================================================
-// function : Build
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_Directory::Build(const OSD_Protection& theProtect)
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : BuildTemporary
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Directory OSD_Directory::BuildTemporary()
{
#ifdef _WIN32
#include <errno.h>
#endif
-// =======================================================================
-// function : OSD_Disk
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Disk::OSD_Disk()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : OSD_Disk
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Disk::OSD_Disk(const OSD_Path& theName)
: myDiskName(theName.Disk())
{
#endif
}
-// =======================================================================
-// function : SetName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_Disk::SetName(const OSD_Path& theName)
{
myDiskName = theName.Disk();
}
-// =======================================================================
-// function : Name
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Path OSD_Disk::Name() const
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : DiskSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OSD_Disk::DiskSize()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : DiskFree
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OSD_Disk::DiskFree()
{
#ifdef _WIN32
#define NEWLINE '\10';
#endif
-// =======================================================================
-// function : OSD_File
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_File::OSD_File()
:
#ifdef _WIN32
//
}
-// =======================================================================
-// function : OSD_File
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_File::OSD_File(const OSD_Path& theName)
: OSD_FileNode(theName),
#ifdef _WIN32
//
}
-// =======================================================================
-// function : ~OSD_File
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_File::~OSD_File()
{
if (IsOpen())
}
}
-// =======================================================================
-// function : Build
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Build(const OSD_OpenMode theMode, const OSD_Protection& theProtect)
{
if (OSD_File::KindOfFile() == OSD_DIRECTORY)
#endif
}
-// =======================================================================
-// function : Append
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Append(const OSD_OpenMode theMode, const OSD_Protection& theProtect)
{
if (OSD_File::KindOfFile() == OSD_DIRECTORY)
#endif
}
-// =======================================================================
-// function : Open
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Open(const OSD_OpenMode theMode, const OSD_Protection& theProtect)
{
if (OSD_File::KindOfFile() == OSD_DIRECTORY)
#endif
}
-// =======================================================================
-// function : BuildTemporary
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::BuildTemporary()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : Read
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Read(TCollection_AsciiString& theBuffer, const Standard_Integer theNbBytes)
{
if (OSD_File::KindOfFile() == OSD_DIRECTORY)
}
}
-// =======================================================================
-// function : ReadLine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::ReadLine(TCollection_AsciiString& theBuffer,
const Standard_Integer theNbBytes,
Standard_Integer& theNbBytesRead)
#endif
}
-// =======================================================================
-// function : KindOfFile
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_KindFile OSD_File::KindOfFile() const
{
TCollection_AsciiString aFullName;
#endif
}
-// =======================================================================
-// function : Read
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Read(const Standard_Address theBuffer,
const Standard_Integer theNbBytes,
Standard_Integer& theNbReadBytes)
#endif
}
-// =======================================================================
-// function : Write
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Write(const Standard_Address theBuffer, const Standard_Integer theNbBytes)
{
if (!IsOpen())
#endif
}
-// =======================================================================
-// function : Seek
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Seek(const Standard_Integer theOffset, const OSD_FromWhere theWhence)
{
if (!IsOpen())
#endif
}
-// =======================================================================
-// function : Close
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Close()
{
if (!IsOpen())
myIO = 0;
}
-// =======================================================================
-// function : IsAtEnd
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_File::IsAtEnd()
{
if (!IsOpen())
#endif
}
-// =======================================================================
-// function : Link
-// purpose :
-// =======================================================================
+//=================================================================================================
+
/*void OSD_File::Link (const TCollection_AsciiString& theToFile)
{
if (!IsOpen())
#define __leave return
#endif
-// =======================================================================
-// function : SetLock
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::SetLock(const OSD_LockType theLock)
{
if (!IsOpen())
#undef __leave
#endif
-// =======================================================================
-// function : UnLock
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::UnLock()
{
if (!IsOpen())
#endif
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OSD_File::Size()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : IsOpen
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_File::IsOpen() const
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : IsReadable
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_File::IsReadable()
{
TCollection_AsciiString aFileName;
#endif
}
-// =======================================================================
-// function : IsWriteable
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_File::IsWriteable()
{
TCollection_AsciiString aFileName;
#endif
}
-// =======================================================================
-// function : IsExecutable
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_File::IsExecutable()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : Rewind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_File::Rewind()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : ReadLastLine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_File::ReadLastLine(TCollection_AsciiString& theLine,
const Standard_Integer theDelay,
const Standard_Integer theNbTries)
return Standard_False;
}
-// =======================================================================
-// function : Edit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_File::Edit()
{
std::cout << "Function OSD_File::Edit() not yet implemented.\n";
EM_JS(double, OSD_MemInfo_getModuleHeapLength, (), { return Module.HEAP8.length; });
#endif
-// =======================================================================
-// function : OSD_MemInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_MemInfo::OSD_MemInfo(const Standard_Boolean theImmediateUpdate)
{
SetActive(Standard_True);
}
}
-// =======================================================================
-// function : SetActive
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_MemInfo::SetActive(const Standard_Boolean theActive)
{
for (Standard_Integer anIter = 0; anIter < MemCounter_NB; ++anIter)
}
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_MemInfo::Clear()
{
for (Standard_Integer anIter = 0; anIter < MemCounter_NB; ++anIter)
}
}
-// =======================================================================
-// function : Update
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_MemInfo::Update()
{
Clear();
#endif
}
-// =======================================================================
-// function : ToString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OSD_MemInfo::ToString() const
{
TCollection_AsciiString anInfo;
return anInfo;
}
-// =======================================================================
-// function : Value
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OSD_MemInfo::Value(const OSD_MemInfo::Counter theCounter) const
{
if (theCounter < 0 || theCounter >= MemCounter_NB || !IsActive(theCounter))
return myCounters[theCounter];
}
-// =======================================================================
-// function : ValueMiB
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OSD_MemInfo::ValueMiB(const OSD_MemInfo::Counter theCounter) const
{
if (theCounter < 0 || theCounter >= MemCounter_NB || !IsActive(theCounter))
: (myCounters[theCounter] / (1024 * 1024));
}
-// =======================================================================
-// function : ValuePreciseMiB
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real OSD_MemInfo::ValuePreciseMiB(const OSD_MemInfo::Counter theCounter) const
{
if (theCounter < 0 || theCounter >= MemCounter_NB || !IsActive(theCounter))
: ((Standard_Real)myCounters[theCounter] / (1024.0 * 1024.0));
}
-// =======================================================================
-// function : ShowInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OSD_MemInfo::PrintInfo()
{
OSD_MemInfo anInfo;
return aFlags;
}
-// ==============================================
-// function : OSD_OpenFile
-// purpose : Opens file
-// ==============================================
+//=================================================================================================
+
int OSD_OpenFileDescriptor(const TCollection_ExtendedString& theName,
::std::ios_base::openmode theMode)
{
return aFileDesc;
}
-// ==============================================
-// function : OSD_OpenFile
-// purpose : Opens file
-// ==============================================
+//=================================================================================================
+
FILE* OSD_OpenFile(const char* theName, const char* theMode)
{
FILE* aFile = 0;
return aFile;
}
-// ==============================================
-// function : OSD_OpenFile
-// purpose : Opens file
-// ==============================================
+//=================================================================================================
+
FILE* OSD_OpenFile(const TCollection_ExtendedString& theName, const char* theMode)
{
FILE* aFile = 0;
return aFile;
}
-// ==============================================
-// function : OSD_FileStatCTime
-// purpose :
-// ==============================================
+//=================================================================================================
+
Standard_Time OSD_FileStatCTime(const char* theName)
{
Standard_Time aTime = 0;
#endif
Standard_ENABLE_DEPRECATION_WARNINGS
- //=======================================================================
- // function : forEachExternal
- // purpose :
- //=======================================================================
+ //=================================================================================================
void
OSD_Parallel::forEachExternal(UniversalIterator& theBegin,
#endif // Windows sources for OSD_Path
-// =======================================================================
-// function : Analyse_VMS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
static Standard_Boolean Analyse_VMS(const TCollection_AsciiString& theName)
{
if (theName.Search("/") != -1 || theName.Search("@") != -1 || theName.Search("\\") != -1)
return Standard_True;
}
-// =======================================================================
-// function : Analyse_DOS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
static Standard_Boolean Analyse_DOS(const TCollection_AsciiString& theName)
{
if (theName.Search("/") != -1 || theName.Search(":") != -1 || theName.Search("*") != -1
return Standard_True;
}
-// =======================================================================
-// function : Analyse_MACOS
-// purpose :
-// =======================================================================
+//=================================================================================================
+
static Standard_Boolean Analyse_MACOS(const TCollection_AsciiString& theName)
{
return theName.Search(":") == -1 ? theName.Length() <= 31 : Standard_True;
}
-// =======================================================================
-// function : IsValid
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OSD_Path::IsValid(const TCollection_AsciiString& theDependentName,
const OSD_SysType theSysType)
{
return Standard_False;
}
-// =======================================================================
-// function : FolderAndFileFromPath
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_Path::FolderAndFileFromPath(const TCollection_AsciiString& theFilePath,
TCollection_AsciiString& theFolder,
TCollection_AsciiString& theFileName)
}
}
-// =======================================================================
-// function : FileNameAndExtension
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_Path::FileNameAndExtension(const TCollection_AsciiString& theFilePath,
TCollection_AsciiString& theName,
TCollection_AsciiString& theExtension)
void _osd_wnt_set_error(OSD_Error&, Standard_Integer, ...);
-// =======================================================================
-// function : OSD_Process
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Process::OSD_Process()
{
//
} // end OSD_Process :: SystemDate
-// =======================================================================
-// function : UserName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OSD_Process::UserName()
{
#ifndef OCCT_UWP
#endif
} // end OSD_Process :: IsSuperUser
-// =======================================================================
-// function : ProcessId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OSD_Process::ProcessId()
{
return (Standard_Integer)GetCurrentProcessId();
}
-// =======================================================================
-// function : CurrentDirectory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_Path OSD_Process::CurrentDirectory()
{
OSD_Path anCurrentDirectory;
#endif
-// =======================================================================
-// function : ExecutablePath
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OSD_Process::ExecutablePath()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : ExecutableFolder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OSD_Process::ExecutableFolder()
{
TCollection_AsciiString aFullPath = ExecutablePath();
IMPLEMENT_STANDARD_RTTIEXT(OSD_ThreadPool, Standard_Transient)
-// =======================================================================
-// function : Lock
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OSD_ThreadPool::EnumeratedThread::Lock()
{
return Standard_Atomic_CompareAndSwap(&myUsageCounter, 0, 1);
}
-// =======================================================================
-// function : Free
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::EnumeratedThread::Free()
{
Standard_Atomic_CompareAndSwap(&myUsageCounter, 1, 0);
}
-// =======================================================================
-// function : WakeUp
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::EnumeratedThread::WakeUp(JobInterface* theJob, bool theToCatchFpe)
{
myJob = theJob;
}
}
-// =======================================================================
-// function : WaitIdle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::EnumeratedThread::WaitIdle()
{
if (!myIsSelfThread)
}
}
-// =======================================================================
-// function : DefaultPool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(OSD_ThreadPool)& OSD_ThreadPool::DefaultPool(int theNbThreads)
{
static const Handle(OSD_ThreadPool) THE_GLOBAL_POOL = new OSD_ThreadPool(theNbThreads);
return THE_GLOBAL_POOL;
}
-// =======================================================================
-// function : OSD_ThreadPool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_ThreadPool::OSD_ThreadPool(int theNbThreads)
: myNbDefThreads(0),
myShutDown(false)
myNbDefThreads = NbThreads();
}
-// =======================================================================
-// function : IsInUse
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OSD_ThreadPool::IsInUse()
{
for (NCollection_Array1<EnumeratedThread>::Iterator aThreadIter(myThreads); aThreadIter.More();
return false;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::Init(int theNbThreads)
{
const int aNbThreads =
}
}
-// =======================================================================
-// function : ~OSD_ThreadPool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_ThreadPool::~OSD_ThreadPool()
{
release();
}
-// =======================================================================
-// function : release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::release()
{
if (myThreads.IsEmpty())
}
}
-// =======================================================================
-// function : perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::Launcher::perform(JobInterface& theJob)
{
run(theJob);
wait();
}
-// =======================================================================
-// function : run
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::Launcher::run(JobInterface& theJob)
{
bool toCatchFpe = OSD::ToCatchFloatingSignals();
}
}
-// =======================================================================
-// function : wait
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::Launcher::wait()
{
int aNbFailures = 0;
throw Standard_ProgramError(aFailures.ToCString(), NULL);
}
-// =======================================================================
-// function : performJob
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::performJob(Handle(Standard_Failure)& theFailure,
OSD_ThreadPool::JobInterface* theJob,
int theThreadIndex)
}
}
-// =======================================================================
-// function : performThread
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::EnumeratedThread::performThread()
{
OSD::SetThreadLocalSignal(OSD::SignalMode(), false);
}
}
-// =======================================================================
-// function : runThread
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Address OSD_ThreadPool::EnumeratedThread::runThread(Standard_Address theTask)
{
EnumeratedThread* aThread = static_cast<EnumeratedThread*>(theTask);
return NULL;
}
-// =======================================================================
-// function : Launcher
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OSD_ThreadPool::Launcher::Launcher(OSD_ThreadPool& thePool, Standard_Integer theMaxThreads)
: mySelfThread(true),
myNbThreads(0)
++myNbThreads;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD_ThreadPool::Launcher::Release()
{
for (NCollection_Array1<EnumeratedThread*>::Iterator aThreadIter(myThreads);
return OSD_WasSetSignal;
}
-// =======================================================================
-// function : SignalStackTraceLength
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OSD::SignalStackTraceLength()
{
return OSD_SignalStackTraceLength;
}
-// =======================================================================
-// function : SetSignalStackTraceLength
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OSD::SetSignalStackTraceLength(Standard_Integer theLength)
{
OSD_SignalStackTraceLength = theLength;
static const Graphic3d_MaterialAspect THE_DEFAULT_MATERIAL = initDefaultMaterial();
} // namespace
-// =======================================================================
-// function : OpenGl_Aspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Aspects::OpenGl_Aspects()
: myAspect(new Graphic3d_Aspects()),
myShadingModel(Graphic3d_TypeOfShadingModel_Unlit)
myAspect->SetHatchStyle(Handle(Graphic3d_HatchStyle)());
}
-// =======================================================================
-// function : OpenGl_Aspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Aspects::OpenGl_Aspects(const Handle(Graphic3d_Aspects)& theAspect)
: myShadingModel(Graphic3d_TypeOfShadingModel_DEFAULT)
{
SetAspect(theAspect);
}
-// =======================================================================
-// function : SetAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Aspects::SetAspect(const Handle(Graphic3d_Aspects)& theAspect)
{
myAspect = theAspect;
}
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Aspects::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
theWorkspace->SetAspects(this);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Aspects::Release(OpenGl_Context* theContext)
{
myResTextureSet.Release(theContext);
myResProgram.Release(theContext);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Aspects::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_Aspects)
static const TCollection_AsciiString THE_EMPTY_KEY;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsProgram::Release(OpenGl_Context* theCtx)
{
if (!myShaderProgram.IsNull() && theCtx != NULL)
myIsShaderReady = Standard_False;
}
-// =======================================================================
-// function : UpdateRediness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsProgram::UpdateRediness(const Handle(Graphic3d_Aspects)& theAspect)
{
const TCollection_AsciiString& aShaderKey =
}
}
-// =======================================================================
-// function : build
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsProgram::build(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_ShaderProgram)& theShader)
{
static const TCollection_AsciiString THE_EMPTY_KEY;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsSprite::Release(OpenGl_Context* theCtx)
{
myIsSpriteReady = Standard_False;
mySpriteA.Nullify();
}
-// =======================================================================
-// function : HasPointSprite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_AspectsSprite::HasPointSprite(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_Aspects)& theAspects)
{
return !aSprite.IsNull() && !aSprite->IsDisplayList();
}
-// =======================================================================
-// function : IsDisplayListSprite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_AspectsSprite::IsDisplayListSprite(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_Aspects)& theAspects)
{
return !aSprite.IsNull() && aSprite->IsDisplayList();
}
-// =======================================================================
-// function : UpdateRediness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsSprite::UpdateRediness(const Handle(Graphic3d_Aspects)& theAspect)
{
// update sprite resource bindings
}
}
-// =======================================================================
-// function : Sprite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(OpenGl_PointSprite)& OpenGl_AspectsSprite::Sprite(
const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_Aspects)& theAspects,
return theIsAlphaSprite && !mySpriteA.IsNull() && mySpriteA->IsValid() ? mySpriteA : mySprite;
}
-// =======================================================================
-// function : build
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsSprite::build(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_MarkerImage)& theMarkerImage,
Aspect_TypeOfMarker theType,
}
}
-// =======================================================================
-// function : spriteKeys
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsSprite::spriteKeys(const Handle(Graphic3d_MarkerImage)& theMarkerImage,
Aspect_TypeOfMarker theType,
Standard_ShortReal theScale,
static const TCollection_AsciiString THE_EMPTY_KEY;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsTextureSet::Release(OpenGl_Context* theCtx)
{
if (myTextures[0].IsNull())
myIsTextureReady = Standard_False;
}
-// =======================================================================
-// function : UpdateRediness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsTextureSet::UpdateRediness(const Handle(Graphic3d_Aspects)& theAspect)
{
const Handle(Graphic3d_TextureSet)& aNewTextureSet = theAspect->TextureSet();
}
}
-// =======================================================================
-// function : build
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_AspectsTextureSet::build(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_Aspects)& theAspect,
const Handle(OpenGl_PointSprite)& theSprite,
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Buffer, OpenGl_Resource)
-// =======================================================================
-// function : sizeOfGlType
-// purpose :
-// =======================================================================
+//=================================================================================================
+
size_t OpenGl_Buffer::sizeOfGlType(unsigned int theType)
{
switch (theType)
}
}
-// =======================================================================
-// function : FormatTarget
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_Buffer::FormatTarget(unsigned int theTarget)
{
switch (theTarget)
return OpenGl_Context::FormatGlEnumHex(theTarget);
}
-// =======================================================================
-// function : OpenGl_Buffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Buffer::OpenGl_Buffer()
: OpenGl_Resource(),
myOffset(NULL),
//
}
-// =======================================================================
-// function : ~OpenGl_Buffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Buffer::~OpenGl_Buffer()
{
Release(NULL);
}
-// =======================================================================
-// function : Create
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::Create(const Handle(OpenGl_Context)& theGlCtx)
{
if (myBufferId == NO_BUFFER && theGlCtx->core15fwd != NULL)
return myBufferId != NO_BUFFER;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Buffer::Release(OpenGl_Context* theGlCtx)
{
if (myBufferId == NO_BUFFER)
myBufferId = NO_BUFFER;
}
-// =======================================================================
-// function : Bind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Buffer::Bind(const Handle(OpenGl_Context)& theGlCtx) const
{
theGlCtx->core15fwd->glBindBuffer(GetTarget(), myBufferId);
}
-// =======================================================================
-// function : Unbind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Buffer::Unbind(const Handle(OpenGl_Context)& theGlCtx) const
{
theGlCtx->core15fwd->glBindBuffer(GetTarget(), NO_BUFFER);
}
-// =======================================================================
-// function : BindBufferBase
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Buffer::BindBufferBase(const Handle(OpenGl_Context)& theGlCtx, unsigned int theIndex)
{
theGlCtx->core30->glBindBufferBase(GetTarget(), theIndex, myBufferId);
}
-// =======================================================================
-// function : UnbindBufferBase
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Buffer::UnbindBufferBase(const Handle(OpenGl_Context)& theGlCtx, unsigned int theIndex)
{
theGlCtx->core30->glBindBufferBase(GetTarget(), theIndex, NO_BUFFER);
}
-// =======================================================================
-// function : BindBufferRange
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Buffer::BindBufferRange(const Handle(OpenGl_Context)& theGlCtx,
unsigned int theIndex,
const intptr_t theOffset,
(GLsizeiptr)theSize);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return init(theGlCtx, theComponentsNb, theElemsNb, theData, GL_FLOAT);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return init(theGlCtx, theComponentsNb, theElemsNb, theData, GL_UNSIGNED_INT);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return init(theGlCtx, theComponentsNb, theElemsNb, theData, GL_UNSIGNED_SHORT);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return init(theGlCtx, theComponentsNb, theElemsNb, theData, GL_UNSIGNED_BYTE);
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return anErr == GL_NO_ERROR;
}
-// =======================================================================
-// function : SubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::SubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return subData(theGlCtx, theElemFrom, theElemsNb, theData, GL_FLOAT);
}
-// =======================================================================
-// function : SubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::SubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return subData(theGlCtx, theElemFrom, theElemsNb, theData, GL_UNSIGNED_INT);
}
-// =======================================================================
-// function : SubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::SubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return subData(theGlCtx, theElemFrom, theElemsNb, theData, GL_UNSIGNED_SHORT);
}
-// =======================================================================
-// function : SubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::SubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return subData(theGlCtx, theElemFrom, theElemsNb, theData, GL_UNSIGNED_BYTE);
}
-// =======================================================================
-// function : subData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::subData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return anErr == GL_NO_ERROR;
}
-// =======================================================================
-// function : subData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::GetSubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return getSubData(theGlCtx, theElemFrom, theElemsNb, theData, GL_FLOAT);
}
-// =======================================================================
-// function : GetSubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::GetSubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return getSubData(theGlCtx, theElemFrom, theElemsNb, theData, GL_UNSIGNED_SHORT);
}
-// =======================================================================
-// function : GetSubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::GetSubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return getSubData(theGlCtx, theElemFrom, theElemsNb, theData, GL_UNSIGNED_INT);
}
-// =======================================================================
-// function : GetSubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::GetSubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return getSubData(theGlCtx, theElemFrom, theElemsNb, theData, GL_UNSIGNED_BYTE);
}
-// =======================================================================
-// function : getSubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Buffer::getSubData(const Handle(OpenGl_Context)& theGlCtx,
const Standard_Integer theElemFrom,
const Standard_Integer theElemsNb,
return isDone;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Buffer::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
}
} // namespace
-// =======================================================================
-// function : RenderCapping
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_CappingAlgo::RenderCapping(const Handle(OpenGl_Workspace)& theWorkspace,
const OpenGl_Structure& theStructure)
{
0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f};
} // namespace
-// =======================================================================
-// function : OpenGl_CappingPlaneResource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_CappingPlaneResource::OpenGl_CappingPlaneResource(
const Handle(Graphic3d_ClipPlane)& thePlane)
: myPrimitives(NULL),
}
}
-// =======================================================================
-// function : OpenGl_CappingPlaneResource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_CappingPlaneResource::~OpenGl_CappingPlaneResource()
{
Release(NULL);
}
-// =======================================================================
-// function : Update
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_CappingPlaneResource::Update(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_Aspects)& theObjAspect)
{
updateAspect(theObjAspect);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_CappingPlaneResource::Release(OpenGl_Context* theContext)
{
OpenGl_Element::Destroy(theContext, myAspect);
myAspectMod = (unsigned int)-1;
}
-// =======================================================================
-// function : updateAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_CappingPlaneResource::updateAspect(const Handle(Graphic3d_Aspects)& theObjAspect)
{
if (myAspect == NULL)
myAspect->SetAspect(myFillAreaAspect);
}
-// =======================================================================
-// function : updateTransform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_CappingPlaneResource::updateTransform(const Handle(OpenGl_Context)& theCtx)
{
if (myEquationMod == myPlaneRoot->MCountEquation()
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Caps, Standard_Transient)
-// =======================================================================
-// function : OpenGl_Caps
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Caps::OpenGl_Caps()
: sRGBDisable(Standard_False),
compressedTexturesDisable(Standard_False),
return *this;
}
-// =======================================================================
-// function : ~OpenGl_Caps
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Caps::~OpenGl_Caps()
{
//
#include <OpenGl_ClippingIterator.hxx>
-// =======================================================================
-// function : OpenGl_Clipping
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Clipping::OpenGl_Clipping()
: myCappedSubPlane(0),
myNbClipping(0),
{
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::Init()
{
myPlanesGlobal.Nullify();
myCappedChain.Nullify();
}
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::Reset(const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes)
{
const Standard_Integer aStartIndex = myPlanesGlobal.IsNull() ? 1 : myPlanesGlobal->Size() + 1;
// should not be a problem since overall number of clipping planes is expected to be quite small.
}
-// =======================================================================
-// function : SetLocalPlanes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::SetLocalPlanes(const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes)
{
const Standard_Integer aStartIndex = myPlanesGlobal.IsNull() ? 1 : myPlanesGlobal->Size() + 1;
add(thePlanes, aStartIndex);
}
-// =======================================================================
-// function : add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::add(const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes,
const Standard_Integer theStartIndex)
{
}
}
-// =======================================================================
-// function : remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::remove(const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes,
const Standard_Integer theStartIndex)
{
}
}
-// =======================================================================
-// function : SetEnabled
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Clipping::SetEnabled(const OpenGl_ClippingIterator& thePlane,
const Standard_Boolean theIsEnabled)
{
return Standard_True;
}
-// =======================================================================
-// function : RestoreDisabled
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::RestoreDisabled()
{
if (myNbDisabled == 0)
}
}
-// =======================================================================
-// function : DisableGlobal
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::DisableGlobal()
{
for (OpenGl_ClippingIterator aPlaneIter(*this); aPlaneIter.More(); aPlaneIter.Next())
}
}
-// =======================================================================
-// function : DisableAllExcept
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::DisableAllExcept(const Handle(Graphic3d_ClipPlane)& theChain,
const Standard_Integer theSubPlaneIndex)
{
myCappedSubPlane = theSubPlaneIndex;
}
-// =======================================================================
-// function : EnableAllExcept
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::EnableAllExcept(const Handle(Graphic3d_ClipPlane)& theChain,
const Standard_Integer theSubPlaneIndex)
{
myCappedSubPlane = -theSubPlaneIndex;
}
-// =======================================================================
-// function : ResetCappingFilter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Clipping::ResetCappingFilter()
{
myCappedChain.Nullify();
}
} // namespace
-// =======================================================================
-// function : OpenGl_Context
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Context::OpenGl_Context(const Handle(OpenGl_Caps)& theCaps)
: core11ffp(NULL),
core11fwd(NULL),
myShaderManager = new OpenGl_ShaderManager(this);
}
-// =======================================================================
-// function : ~OpenGl_Context
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Context::~OpenGl_Context()
{
// release clean up queue
}
}
-// =======================================================================
-// function : forcedRelease
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::forcedRelease()
{
ReleaseDelayed();
}
}
-// =======================================================================
-// function : ResizeViewport
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ResizeViewport(const Standard_Integer* theRect)
{
core11fwd->glViewport(theRect[0], theRect[1], theRect[2], theRect[3]);
}
}
-// =======================================================================
-// function : SetReadBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetReadBuffer(const Standard_Integer theReadBuffer)
{
if (myGapi == Aspect_GraphicsLibrary_OpenGLES)
core11fwd->glReadBuffer(myReadBuffer);
}
-// =======================================================================
-// function : SetDrawBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetDrawBuffer(const Standard_Integer theDrawBuffer)
{
if (myGapi == Aspect_GraphicsLibrary_OpenGLES)
myDrawBuffers.SetValue(0, aDrawBuffer);
}
-// =======================================================================
-// function : SetDrawBuffers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetDrawBuffers(const Standard_Integer theNb,
const Standard_Integer* theDrawBuffers)
{
myFuncs->glDrawBuffers(theNb, (const GLenum*)theDrawBuffers);
}
-// =======================================================================
-// function : SetFrameBufferSRGB
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetFrameBufferSRGB(bool theIsFbo, bool theIsFboSRgb)
{
if (!hasFboSRGB)
}
}
-// =======================================================================
-// function : SetFaceCulling
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetFaceCulling(Graphic3d_TypeOfBackfacingModel theMode)
{
if (myFaceCulling == theMode)
myFaceCulling = theMode;
}
-// =======================================================================
-// function : FetchState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::FetchState()
{
if (myGapi == Aspect_GraphicsLibrary_OpenGLES)
}
}
-// =======================================================================
-// function : Share
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::Share(const Handle(OpenGl_Context)& theShareCtx)
{
if (!theShareCtx.IsNull())
#if !defined(__APPLE__) || defined(HAVE_XLIB)
-// =======================================================================
-// function : IsCurrent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::IsCurrent() const
{
#if defined(HAVE_EGL)
#endif
}
-// =======================================================================
-// function : MakeCurrent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::MakeCurrent()
{
#if defined(HAVE_EGL)
return Standard_True;
}
-// =======================================================================
-// function : SwapBuffers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SwapBuffers()
{
#if defined(HAVE_EGL)
#endif // __APPLE__
-// =======================================================================
-// function : SetSwapInterval
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::SetSwapInterval(const Standard_Integer theInterval)
{
#if defined(HAVE_EGL)
return Standard_False;
}
-// =======================================================================
-// function : findProc
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void* OpenGl_Context::findProc(const char* theFuncName)
{
#if defined(HAVE_EGL)
#endif
}
-// =======================================================================
-// function : CheckExtension
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::CheckExtension(const char* theExtName) const
{
if (theExtName == NULL)
#endif
}
-// =======================================================================
-// function : CheckExtension
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::CheckExtension(const char* theExtString, const char* theExtName)
{
if (theExtString == NULL)
#if !defined(__APPLE__) || defined(HAVE_XLIB)
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::Init(const Standard_Boolean theIsCoreProfile)
{
if (myIsInitialized)
#endif // __APPLE__
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::Init(const Aspect_Drawable theSurface,
const Aspect_Display theDisplay,
const Aspect_RenderingContext theContext,
return Standard_True;
}
-// =======================================================================
-// function : FormatGlEnumHex
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_Context::FormatGlEnumHex(int theGlEnum)
{
char aBuff[16];
return aBuff;
}
-// =======================================================================
-// function : FormatSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_Context::FormatSize(Standard_Size theSize)
{
char aBuff[32];
return aBuff;
}
-// =======================================================================
-// function : FormatPointer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_Context::FormatPointer(const void* thePtr)
{
char aBuff[32];
return aBuff;
}
-// =======================================================================
-// function : FormatGlError
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_Context::FormatGlError(int theGlError)
{
switch (theGlError)
return FormatGlEnumHex(theGlError);
}
-// =======================================================================
-// function : ResetErrors
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Context::ResetErrors(const bool theToPrintErrors)
{
int aPrevErr = 0;
return hasError;
}
-// =======================================================================
-// function : ReadGlVersion
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ReadGlVersion(Standard_Integer& theGlVerMajor, Standard_Integer& theGlVerMinor)
{
OpenGl_GlFunctions::readGlVersion(theGlVerMajor, theGlVerMinor);
aCtx->PushMessage(theSource, theType, theId, theSeverity, theMessage);
}
-// =======================================================================
-// function : PushMessage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::PushMessage(const unsigned int theSource,
const unsigned int theType,
const unsigned int theId,
Messenger()->Send(aMsg, aGrav);
}
-// =======================================================================
-// function : ExcludeMessage
-// purpose :
-// ======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::ExcludeMessage(const unsigned int theSource,
const unsigned int theId)
{
&& myFilters[theSource - GL_DEBUG_SOURCE_API].Add(theId);
}
-// =======================================================================
-// function : IncludeMessage
-// purpose :
-// ======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::IncludeMessage(const unsigned int theSource,
const unsigned int theId)
{
&& myFilters[theSource - GL_DEBUG_SOURCE_API].Remove(theId);
}
-// =======================================================================
-// function : checkWrongVersion
-// purpose :
-// ======================================================================
+//=================================================================================================
+
void OpenGl_Context::checkWrongVersion(Standard_Integer theGlVerMajor,
Standard_Integer theGlVerMinor,
const char* theLastFailedProc)
}
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::init(const Standard_Boolean theIsCoreProfile)
{
// read version
}
}
-// =======================================================================
-// function : MemoryInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_Context::AvailableMemory() const
{
if (atiMem)
return 0;
}
-// =======================================================================
-// function : MemoryInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_Context::MemoryInfo() const
{
TColStd_IndexedDataMapOfStringString aDict;
return aText;
}
-// =======================================================================
-// function : MemoryInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::MemoryInfo(TColStd_IndexedDataMapOfStringString& theDict) const
{
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#endif
}
-// =======================================================================
-// function : WindowBufferBits
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::WindowBufferBits(Graphic3d_Vec4i& theColorBits,
Graphic3d_Vec2i& theDepthStencilBits) const
{
}
}
-// =======================================================================
-// function : DiagnosticInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::DiagnosticInformation(TColStd_IndexedDataMapOfStringString& theDict,
Graphic3d_DiagnosticInfo theFlags) const
{
}
}
-// =======================================================================
-// function : GetResource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(OpenGl_Resource)& OpenGl_Context::GetResource(
const TCollection_AsciiString& theKey) const
{
return mySharedResources->IsBound(theKey) ? mySharedResources->Find(theKey) : NULL_GL_RESOURCE;
}
-// =======================================================================
-// function : ShareResource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::ShareResource(const TCollection_AsciiString& theKey,
const Handle(OpenGl_Resource)& theResource)
{
return mySharedResources->Bind(theKey, theResource);
}
-// =======================================================================
-// function : ReleaseResource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ReleaseResource(const TCollection_AsciiString& theKey,
const Standard_Boolean theToDelay)
{
}
}
-// =======================================================================
-// function : ReleaseDelayed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ReleaseDelayed()
{
// release queued elements
}
}
-// =======================================================================
-// function : BindTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(OpenGl_TextureSet) OpenGl_Context::BindTextures(
const Handle(OpenGl_TextureSet)& theTextures,
const Handle(OpenGl_ShaderProgram)& theProgram)
return anOldTextures;
}
-// =======================================================================
-// function : BindProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::BindProgram(const Handle(OpenGl_ShaderProgram)& theProgram)
{
if (core20fwd == NULL)
return Standard_True;
}
-// =======================================================================
-// function : BindDefaultVao
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::BindDefaultVao()
{
if (myDefaultVao == 0 || core32 == NULL)
core32->glBindVertexArray(myDefaultVao);
}
-// =======================================================================
-// function : SetDefaultFrameBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(OpenGl_FrameBuffer) OpenGl_Context::SetDefaultFrameBuffer(
const Handle(OpenGl_FrameBuffer)& theFbo)
{
return aFbo;
}
-// =======================================================================
-// function : IsRender
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::IsRender() const
{
return myRenderMode == GL_RENDER;
}
-// =======================================================================
-// function : IsFeedback
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::IsFeedback() const
{
return myRenderMode == GL_FEEDBACK;
}
-// =======================================================================
-// function : SetShadingMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetShadingMaterial(
const OpenGl_Aspects* theAspect,
const Handle(Graphic3d_PresentationAttributes)& theHighlight)
myShaderManager->UpdateMaterialStateTo(myMaterial, anAlphaCutoff, toDistinguish, toMapTexture);
}
-// =======================================================================
-// function : CheckIsTransparent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::CheckIsTransparent(
const OpenGl_Aspects* theAspect,
const Handle(Graphic3d_PresentationAttributes)& theHighlight,
return anAspect->AlphaMode() == Graphic3d_AlphaMode_Blend;
}
-// =======================================================================
-// function : SetColor4fv
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetColor4fv(const OpenGl_Vec4& theColor)
{
if (!myActiveProgram.IsNull())
}
}
-// =======================================================================
-// function : SetTypeOfLine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetTypeOfLine(const Aspect_TypeOfLine theType,
const Standard_ShortReal theFactor)
{
SetLineStipple(theFactor, Graphic3d_Aspects::DefaultLinePatternForType(theType));
}
-// =======================================================================
-// function : SetLineStipple
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetLineStipple(const Standard_ShortReal theFactor, const uint16_t thePattern)
{
if (!myActiveProgram.IsNull())
}
}
-// =======================================================================
-// function : SetLineWidth
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetLineWidth(const Standard_ShortReal theWidth)
{
if (myGapi == Aspect_GraphicsLibrary_OpenGLES || core11ffp != NULL)
}
}
-// =======================================================================
-// function : SetTextureMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetTextureMatrix(const Handle(Graphic3d_TextureParams)& theParams,
const Standard_Boolean theIsTopDown)
{
}
}
-// =======================================================================
-// function : SetPointSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetPointSize(const Standard_ShortReal theSize)
{
if (!myActiveProgram.IsNull())
}
}
-// =======================================================================
-// function : SetPointSpriteOrigin
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetPointSpriteOrigin()
{
if (myGapi == Aspect_GraphicsLibrary_OpenGLES || core15fwd == NULL)
}
}
-// =======================================================================
-// function : SetGlNormalizeEnabled
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Context::SetGlNormalizeEnabled(Standard_Boolean isEnabled)
{
if (isEnabled == myIsGlNormalizeEnabled)
return anOldGlNormalize;
}
-// =======================================================================
-// function : SetShadeModel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetShadeModel(Graphic3d_TypeOfShadingModel theModel)
{
if (core11ffp != NULL)
}
}
-// =======================================================================
-// function : SetPolygonMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OpenGl_Context::SetPolygonMode(const Standard_Integer theMode)
{
if (myPolygonMode == theMode)
return anOldPolygonMode;
}
-// =======================================================================
-// function : SetPolygonHatchEnabled
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Context::SetPolygonHatchEnabled(const bool theIsEnabled)
{
if (core11ffp == NULL)
return anOldIsEnabled;
}
-// =======================================================================
-// function : SetPolygonHatchStyle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OpenGl_Context::SetPolygonHatchStyle(const Handle(Graphic3d_HatchStyle)& theStyle)
{
const Standard_Integer aNewStyle = !theStyle.IsNull() ? theStyle->HatchType() : Aspect_HS_SOLID;
return anOldType;
}
-// =======================================================================
-// function : SetPolygonOffset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetPolygonOffset(const Graphic3d_PolygonOffset& theOffset)
{
const bool toFillOld = (myPolygonOffset.Mode & Aspect_POM_Fill) == Aspect_POM_Fill;
myPolygonOffset = theOffset;
}
-// =======================================================================
-// function : SetCamera
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetCamera(const Handle(Graphic3d_Camera)& theCamera)
{
myCamera = theCamera;
}
}
-// =======================================================================
-// function : ApplyModelWorldMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ApplyModelWorldMatrix()
{
if (myShaderManager->ModelWorldState().ModelWorldMatrix() != ModelWorldState.Current())
}
}
-// =======================================================================
-// function : ApplyWorldViewMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ApplyWorldViewMatrix()
{
if (myShaderManager->ModelWorldState().ModelWorldMatrix() != THE_IDENTITY_MATRIX)
}
}
-// =======================================================================
-// function : ApplyModelViewMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ApplyModelViewMatrix()
{
if (myShaderManager->ModelWorldState().ModelWorldMatrix() != ModelWorldState.Current())
}
}
-// =======================================================================
-// function : ApplyProjectionMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::ApplyProjectionMatrix()
{
if (myShaderManager->ProjectionState().ProjectionMatrix() != ProjectionState.Current())
}
}
-// =======================================================================
-// function : EnableFeatures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::EnableFeatures() const
{
//
}
-// =======================================================================
-// function : DisableFeatures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::DisableFeatures() const
{
// Disable stuff that's likely to slow down glDrawPixels.
}
}
-// =======================================================================
-// function : SetColorMaskRGBA
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::SetColorMaskRGBA(const NCollection_Vec4<bool>& theVal)
{
core11fwd->glColorMask(theVal.r() ? GL_TRUE : GL_FALSE,
myColorMask = theVal;
}
-// =======================================================================
-// function : SetColorMask
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Context::SetColorMask(bool theToWriteColor)
{
const bool anOldValue = myColorMask.r();
return anOldValue;
}
-// =======================================================================
-// function : SetSampleAlphaToCoverage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Context::SetSampleAlphaToCoverage(bool theToEnable)
{
bool toEnable = myAllowAlphaToCov && theToEnable;
return anOldValue;
}
-// =======================================================================
-// function : GetBufferSubData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Context::GetBufferSubData(unsigned int theTarget,
intptr_t theOffset,
intptr_t theSize,
#endif
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
OCCT_DUMP_FIELD_VALUES_DUMPED(theOStream, theDepth, &ProjectionState)
}
-// =======================================================================
-// function : DumpJsonOpenGlState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Context::DumpJsonOpenGlState(Standard_OStream& theOStream, Standard_Integer)
{
GLboolean isEnableBlend = core11fwd->glIsEnabled(GL_BLEND);
myBlendBackFboOit = new OpenGl_FrameBuffer(myResourceId + ":fbo_blend");
}
-// =======================================================================
-// function : ~OpenGl_DepthPeeling
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_DepthPeeling::~OpenGl_DepthPeeling()
{
Release(NULL);
#include <Graphic3d_FrameStatsData.hxx>
#include <Standard_Dump.hxx>
-// =======================================================================
-// function : OpenGl_Element
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Element::OpenGl_Element()
{
//
}
-// =======================================================================
-// function : ~OpenGl_Element
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Element::~OpenGl_Element()
{
//
}
-// =======================================================================
-// function : UpdateMemStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Element::UpdateMemStats(Graphic3d_FrameStatsDataTmp& theStats) const
{
theStats[Graphic3d_FrameStatsCounter_EstimatedBytesGeom] += EstimatedDataSize();
}
-// =======================================================================
-// function : UpdateDrawStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Element::UpdateDrawStats(Graphic3d_FrameStatsDataTmp&, bool) const
{
//
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Element::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_Element)
#include <gp_Ax2.hxx>
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Flipper::OpenGl_Flipper(const gp_Ax2& theReferenceSystem)
: OpenGl_Element(),
myReferenceOrigin((Standard_ShortReal)theReferenceSystem.Location().X(),
//
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Flipper::Release(OpenGl_Context*)
{
//
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Flipper::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
// Check if rendering is to be in immediate mode
aContext->ApplyModelWorldMatrix();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Flipper::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_Flipper)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Font, OpenGl_Resource)
-// =======================================================================
-// function : OpenGl_Font
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Font::OpenGl_Font(const Handle(Font_FTFont)& theFont, const TCollection_AsciiString& theKey)
: myKey(theKey),
myFont(theFont),
memset(&myLastTilePx, 0, sizeof(myLastTilePx));
}
-// =======================================================================
-// function : ~OpenGl_Font
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Font::~OpenGl_Font()
{
Release(NULL);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Font::Release(OpenGl_Context* theCtx)
{
if (myTextures.IsEmpty())
myTextures.Clear();
}
-// =======================================================================
-// function : EstimatedDataSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_Font::EstimatedDataSize() const
{
Standard_Size aSize = 0;
return aSize;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Font::Init(const Handle(OpenGl_Context)& theCtx)
{
Release(theCtx.operator->());
return true;
}
-// =======================================================================
-// function : createTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Font::createTexture(const Handle(OpenGl_Context)& theCtx)
{
// Single font might define very wide range of symbols, with very few of them actually used in
return true;
}
-// =======================================================================
-// function : renderGlyph
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Font::renderGlyph(const Handle(OpenGl_Context)& theCtx,
const Standard_Utf32Char theChar)
{
return true;
}
-// =======================================================================
-// function : RenderGlyph
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Font::RenderGlyph(const Handle(OpenGl_Context)& theCtx,
const Standard_Utf32Char theUChar,
Tile& theGlyph)
}
} // namespace
-// =======================================================================
-// function : OpenGl_FrameBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_FrameBuffer::OpenGl_FrameBuffer(const TCollection_AsciiString& theResourceId)
: OpenGl_NamedResource(theResourceId),
myInitVPSizeX(0),
myColorTextures.Append(new OpenGl_Texture(theResourceId + ":color"));
}
-// =======================================================================
-// function : ~OpenGl_FrameBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_FrameBuffer::~OpenGl_FrameBuffer()
{
Release(NULL);
}
-// =======================================================================
-// function : GetSizeX
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OpenGl_FrameBuffer::GetSizeX() const
{
return !myColorTextures.IsEmpty() ? myColorTextures.First()->SizeX() : 0;
}
-// =======================================================================
-// function : GetSizeY
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OpenGl_FrameBuffer::GetSizeY() const
{
return !myColorTextures.IsEmpty() ? myColorTextures.First()->SizeY() : 0;
}
-// =======================================================================
-// function : InitWrapper
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::InitWrapper(
const Handle(OpenGl_Context)& theGlContext,
const NCollection_Sequence<Handle(OpenGl_Texture)>& theColorTextures,
return true;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::Init(const Handle(OpenGl_Context)& theGlContext,
const Graphic3d_Vec2i& theSize,
const Standard_Integer theColorFormat,
return Init(theGlContext, theSize, aColorFormats, theDepthFormat, theNbSamples);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::Init(const Handle(OpenGl_Context)& theGlContext,
const Graphic3d_Vec2i& theSize,
const OpenGl_ColorFormats& theColorFormats,
return Standard_True;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::Init(const Handle(OpenGl_Context)& theGlContext,
const Graphic3d_Vec2i& theSize,
const OpenGl_ColorFormats& theColorFormats,
return Standard_True;
}
-// =======================================================================
-// function : InitLazy
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::InitLazy(const Handle(OpenGl_Context)& theGlContext,
const Graphic3d_Vec2i& theViewportSize,
const Standard_Integer theColorFormat,
return InitLazy(theGlContext, theViewportSize, aColorFormats, theDepthFormat, theNbSamples);
}
-// =======================================================================
-// function : InitLazy
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::InitLazy(const Handle(OpenGl_Context)& theGlContext,
const Graphic3d_Vec2i& theViewportSize,
const OpenGl_ColorFormats& theColorFormats,
return Init(theGlContext, theViewportSize, theColorFormats, theDepthFormat, theNbSamples);
}
-// =======================================================================
-// function : InitWithRB
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::InitWithRB(const Handle(OpenGl_Context)& theGlCtx,
const Graphic3d_Vec2i& theSize,
const Standard_Integer theColorFormat,
theColorRBufferFromWindow);
}
-// =======================================================================
-// function : initRenderBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::initRenderBuffer(const Handle(OpenGl_Context)& theGlCtx,
const Graphic3d_Vec2i& theSize,
const OpenGl_ColorFormats& theColorFormats,
return Standard_True;
}
-// =======================================================================
-// function : InitWrapper
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::InitWrapper(const Handle(OpenGl_Context)& theGlCtx)
{
myNbSamples = 0;
return Standard_True;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameBuffer::Release(OpenGl_Context* theGlCtx)
{
if (isValidFrameBuffer())
myVPSizeY = 0;
}
-// =======================================================================
-// function : SetupViewport
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameBuffer::SetupViewport(const Handle(OpenGl_Context)& theGlCtx)
{
const Standard_Integer aViewport[4] = {0, 0, myVPSizeX, myVPSizeY};
theGlCtx->ResizeViewport(aViewport);
}
-// =======================================================================
-// function : ChangeViewport
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameBuffer::ChangeViewport(const Standard_Integer theVPSizeX,
const Standard_Integer theVPSizeY)
{
myVPSizeY = theVPSizeY;
}
-// =======================================================================
-// function : BindBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameBuffer::BindBuffer(const Handle(OpenGl_Context)& theGlCtx)
{
theGlCtx->arbFBO->glBindFramebuffer(GL_FRAMEBUFFER, myGlFBufferId);
theGlCtx->SetFrameBufferSRGB(true);
}
-// =======================================================================
-// function : BindDrawBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameBuffer::BindDrawBuffer(const Handle(OpenGl_Context)& theGlCtx)
{
theGlCtx->arbFBO->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, myGlFBufferId);
theGlCtx->SetFrameBufferSRGB(true);
}
-// =======================================================================
-// function : BindReadBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameBuffer::BindReadBuffer(const Handle(OpenGl_Context)& theGlCtx)
{
theGlCtx->arbFBO->glBindFramebuffer(GL_READ_FRAMEBUFFER, myGlFBufferId);
}
-// =======================================================================
-// function : UnbindBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameBuffer::UnbindBuffer(const Handle(OpenGl_Context)& theGlCtx)
{
if (!theGlCtx->DefaultFrameBuffer().IsNull()
}
}
-// =======================================================================
-// function : getAligned
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline Standard_Size getAligned(const Standard_Size theNumber, const Standard_Size theAlignment)
{
return theNumber + theAlignment - 1 - (theNumber - 1) % theAlignment;
}
}
-// =======================================================================
-// function : BufferDump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_FrameBuffer::BufferDump(const Handle(OpenGl_Context)& theGlCtx,
const Handle(OpenGl_FrameBuffer)& theFbo,
Image_PixMap& theImage,
return !hasErrors;
}
-// =======================================================================
-// function : EstimatedDataSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_FrameBuffer::EstimatedDataSize() const
{
if (!IsValid())
}
} // namespace
-// =======================================================================
-// function : OpenGl_FrameStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_FrameStats::OpenGl_FrameStats()
{
//
}
-// =======================================================================
-// function : ~OpenGl_FrameStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_FrameStats::~OpenGl_FrameStats()
{
//
}
-// =======================================================================
-// function : IsFrameUpdated
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_FrameStats::IsFrameUpdated(Handle(OpenGl_FrameStats)& thePrev) const
{
const Graphic3d_FrameStatsData& aFrame = LastDataFrame();
return true;
}
-// =======================================================================
-// function : updateStatistics
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameStats::updateStatistics(const Handle(Graphic3d_CView)& theView,
bool theIsImmediateOnly)
{
}
}
-// =======================================================================
-// function : updateStructures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameStats::updateStructures(
Standard_Integer theViewId,
const NCollection_IndexedMap<const Graphic3d_CStructure*>& theStructures,
}
} // namespace
-// =======================================================================
-// function : OpenGl_FrameStatsPrs
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_FrameStatsPrs::OpenGl_FrameStatsPrs()
: myStatsPrev(new OpenGl_FrameStats()),
myCountersTrsfPers(new Graphic3d_TransformPers(Graphic3d_TMF_2d,
//
}
-// =======================================================================
-// function : ~OpenGl_FrameStatsPrs
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_FrameStatsPrs::~OpenGl_FrameStatsPrs()
{
//
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameStatsPrs::Release(OpenGl_Context* theCtx)
{
myCountersText.Release(theCtx);
myChartLines->Release(theCtx);
}
-// =======================================================================
-// function : Update
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameStatsPrs::Update(const Handle(OpenGl_Workspace)& theWorkspace)
{
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
updateChart(theWorkspace);
}
-// =======================================================================
-// function : updateChart
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameStatsPrs::updateChart(const Handle(OpenGl_Workspace)& theWorkspace)
{
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
}
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameStatsPrs::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_FrameStatsPrs::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_FrameStatsPrs)
#endif
} // namespace opencascade
-// =======================================================================
-// function : debugPrintError
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_GlFunctions::debugPrintError(const char* theName)
{
const int anErr = ::glGetError();
return anErr != GL_NO_ERROR;
}
-// =======================================================================
-// function : readGlVersion
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GlFunctions::readGlVersion(Standard_Integer& theGlVerMajor,
Standard_Integer& theGlVerMinor)
{
}
}
-// =======================================================================
-// function : load
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GlFunctions::load(OpenGl_Context& theCtx, Standard_Boolean theIsCoreProfile)
{
#if !defined(GL_ES_VERSION_2_0)
static Graphic3d_VerticalTextAlignment THE_LABEL_VALIGH = Graphic3d_VTA_BOTTOM;
} // namespace
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_GraduatedTrihedron::OpenGl_GraduatedTrihedron()
: myMin(0.0f, 0.0f, 0.0f),
myMax(100.0f, 100.0f, 100.0f),
//
}
-// =======================================================================
-// function : SetValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::SetValues(const Graphic3d_GraduatedTrihedron& theData)
{
myData = theData;
myIsInitialized = Standard_False;
}
-// =======================================================================
-// function : Destructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_GraduatedTrihedron::~OpenGl_GraduatedTrihedron()
{
//
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::Release(OpenGl_Context* theCtx)
{
myAxes[0].Release(theCtx);
myLabelValues.Release(theCtx);
}
-// =======================================================================
-// function : initResources
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::initGlResources(const Handle(OpenGl_Context)& theCtx) const
{
myAxes[0].Release(theCtx.operator->());
}
}
-// =======================================================================
-// function : renderLine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::renderLine(const OpenGl_PrimitiveArray& theLine,
const Handle(OpenGl_Workspace)& theWorkspace,
const OpenGl_Mat4& theMat,
theLine.Render(theWorkspace);
}
-// =======================================================================
-// function : renderGridPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::renderGridPlane(const Handle(OpenGl_Workspace)& theWorkspace,
const Standard_Integer& theIndex,
const GridAxes& theGridAxes,
}
}
-// =======================================================================
-// function : renderAxis
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::renderAxis(const Handle(OpenGl_Workspace)& theWorkspace,
const Standard_Integer& theIndex,
const OpenGl_Mat4& theMat) const
anAxis.Line.Render(theWorkspace);
}
-// =======================================================================
-// function : renderTickmarkTextLabels
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::renderTickmarkLabels(const Handle(OpenGl_Workspace)& theWorkspace,
const OpenGl_Mat4& theMat,
const Standard_Integer theIndex,
anArray->Bounds());
}
-// =======================================================================
-// function : InitTickmark
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::Axis::InitTickmark(const Handle(OpenGl_Context)& theContext,
const OpenGl_Vec3& theDir) const
{
anArray->Bounds());
}
-// =======================================================================
-// function : InitLine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::Axis::InitLine(const Handle(OpenGl_Context)& theContext,
const OpenGl_Vec3& theDir) const
{
anArray->Bounds());
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::Axis::Release(OpenGl_Context* theCtx)
{
Label.Release(theCtx);
Arrow.Release(theCtx);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraduatedTrihedron::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
} // namespace
-// =======================================================================
-// function : OpenGl_GraphicDriver
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_GraphicDriver::OpenGl_GraphicDriver(const Handle(Aspect_DisplayConnection)& theDisp,
const Standard_Boolean theToInitialize)
: Graphic3d_GraphicDriver(theDisp),
}
}
-// =======================================================================
-// function : ~OpenGl_GraphicDriver
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_GraphicDriver::~OpenGl_GraphicDriver()
{
ReleaseContext();
}
-// =======================================================================
-// function : ReleaseContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::ReleaseContext()
{
Handle(OpenGl_Context) aCtxShared;
myIsOwnContext = Standard_False;
}
-// =======================================================================
-// function : InitContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_GraphicDriver::InitContext()
{
ReleaseContext();
return Standard_True;
}
-// =======================================================================
-// function : InitEglContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_GraphicDriver::InitEglContext(Aspect_Display theEglDisplay,
Aspect_RenderingContext theEglContext,
void* theEglConfig)
#endif
}
-// =======================================================================
-// function : chooseVisualInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::chooseVisualInfo()
{
if (myDisplayConnection.IsNull())
#endif
}
-// =======================================================================
-// function : InquireLimit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OpenGl_GraphicDriver::InquireLimit(const Graphic3d_TypeOfLimit theType) const
{
const Handle(OpenGl_Context)& aCtx = GetSharedContext();
return 0;
}
-// =======================================================================
-// function : DefaultTextHeight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ShortReal OpenGl_GraphicDriver::DefaultTextHeight() const
{
return 16.;
}
-// =======================================================================
-// function : EnableVBO
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::EnableVBO(const Standard_Boolean theToTurnOn)
{
myCaps->vboDisable = !theToTurnOn;
}
-// =======================================================================
-// function : IsVerticalSync
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_GraphicDriver::IsVerticalSync() const
{
return myCaps->swapInterval == 1;
}
-// =======================================================================
-// function : SetVerticalSync
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::SetVerticalSync(bool theToEnable)
{
myCaps->swapInterval = theToEnable ? 1 : 0;
}
-// =======================================================================
-// function : GetSharedContext
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(OpenGl_Context)& OpenGl_GraphicDriver::GetSharedContext(bool theBound) const
{
if (myMapOfView.IsEmpty())
return TheNullGlCtx;
}
-// =======================================================================
-// function : MemoryInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_GraphicDriver::MemoryInfo(Standard_Size& theFreeBytes,
TCollection_AsciiString& theInfo) const
{
return !theInfo.IsEmpty();
}
-// =======================================================================
-// function : SetBuffersNoSwap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::SetBuffersNoSwap(const Standard_Boolean theIsNoSwap)
{
myCaps->buffersNoSwap = theIsNoSwap;
}
-// =======================================================================
-// function : TextSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::TextSize(const Handle(Graphic3d_CView)& theView,
const Standard_CString theText,
const Standard_ShortReal theHeight,
}
}
-// =======================================================================
-// function : Structure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_CStructure) OpenGl_GraphicDriver::CreateStructure(
const Handle(Graphic3d_StructureManager)& theManager)
{
return aStructure;
}
-// =======================================================================
-// function : Structure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::RemoveStructure(Handle(Graphic3d_CStructure)& theCStructure)
{
OpenGl_Structure* aStructure = NULL;
theCStructure.Nullify();
}
-// =======================================================================
-// function : CreateView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_CView) OpenGl_GraphicDriver::CreateView(
const Handle(Graphic3d_StructureManager)& theMgr)
{
return aView;
}
-// =======================================================================
-// function : RemoveView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_GraphicDriver::RemoveView(const Handle(Graphic3d_CView)& theView)
{
Handle(OpenGl_Context) aCtx = GetSharedContext();
}
}
-// =======================================================================
-// function : CreateRenderWindow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(OpenGl_Window) OpenGl_GraphicDriver::CreateRenderWindow(
const Handle(Aspect_Window)& theNativeWindow,
const Handle(Aspect_Window)& theSizeWindow,
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_GraphicDriverFactory, Graphic3d_GraphicDriverFactory)
-// =======================================================================
-// function : OpenGl_GraphicDriverFactory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_GraphicDriverFactory::OpenGl_GraphicDriverFactory()
: Graphic3d_GraphicDriverFactory(OpenGl_DRIVER_NAME),
myDefaultCaps(new OpenGl_Caps())
//
}
-// =======================================================================
-// function : CreateDriver
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_GraphicDriver) OpenGl_GraphicDriverFactory::CreateDriver(
const Handle(Aspect_DisplayConnection)& theDisp)
{
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Group, Graphic3d_Group)
-// =======================================================================
-// function : OpenGl_Group
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Group::OpenGl_Group(const Handle(Graphic3d_Structure)& theStruct)
: Graphic3d_Group(theStruct),
myAspects(NULL),
}
}
-// =======================================================================
-// function : ~OpenGl_Group
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Group::~OpenGl_Group()
{
Release(Handle(OpenGl_Context)());
}
-// =======================================================================
-// function : SetGroupPrimitivesAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::SetGroupPrimitivesAspect(const Handle(Graphic3d_Aspects)& theAspect)
{
if (IsDeleted())
Update();
}
-// =======================================================================
-// function : SetPrimitivesAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::SetPrimitivesAspect(const Handle(Graphic3d_Aspects)& theAspect)
{
if (myAspects == NULL)
Update();
}
-// =======================================================================
-// function : SynchronizeAspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::SynchronizeAspects()
{
if (myAspects != NULL)
}
}
-// =======================================================================
-// function : ReplaceAspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::ReplaceAspects(const Graphic3d_MapOfAspectsToAspects& theMap)
{
if (theMap.IsEmpty())
}
}
-// =======================================================================
-// function : AddPrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::AddPrimitiveArray(const Graphic3d_TypeOfPrimitiveArray theType,
const Handle(Graphic3d_IndexBuffer)& theIndices,
const Handle(Graphic3d_Buffer)& theAttribs,
Graphic3d_Group::AddPrimitiveArray(theType, theIndices, theAttribs, theBounds, theToEvalMinMax);
}
-// =======================================================================
-// function : AddText
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::AddText(const Handle(Graphic3d_Text)& theTextParams,
const Standard_Boolean theToEvalMinMax)
{
Graphic3d_Group::AddText(theTextParams, theToEvalMinMax);
}
-// =======================================================================
-// function : SetFlippingOptions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::SetFlippingOptions(const Standard_Boolean theIsEnabled,
const gp_Ax2& theRefPlane)
{
AddElement(aFlipper);
}
-// =======================================================================
-// function : SetStencilTestOptions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::SetStencilTestOptions(const Standard_Boolean theIsEnabled)
{
OpenGl_StencilTest* aStencilTest = new OpenGl_StencilTest();
AddElement(aStencilTest);
}
-// =======================================================================
-// function : AddElement
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::AddElement(OpenGl_Element* theElem)
{
OpenGl_ElementNode* aNode = new OpenGl_ElementNode();
}
}
-// =======================================================================
-// function : renderFiltered
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Group::renderFiltered(const Handle(OpenGl_Workspace)& theWorkspace,
OpenGl_Element* theElement) const
{
return true;
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
// Setup aspects
theWorkspace->SetAspects(aBackAspects);
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::Clear(const Standard_Boolean theToUpdateStructureMgr)
{
if (IsDeleted())
myIsRaytracable = Standard_False;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::Release(const Handle(OpenGl_Context)& theGlCtx)
{
// Delete elements
OpenGl_Element::Destroy(theGlCtx.get(), myAspects);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Group::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_IndexBuffer, OpenGl_Buffer)
-// =======================================================================
-// function : OpenGl_IndexBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_IndexBuffer::OpenGl_IndexBuffer()
: OpenGl_Buffer()
{
}
-// =======================================================================
-// function : GetTarget
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int OpenGl_IndexBuffer::GetTarget() const
{
return GL_ELEMENT_ARRAY_BUFFER;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_IndexBuffer::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
aCtx->core11fwd->glDepthFunc(theGlobalSettings.DepthFunc);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_LayerList::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_LayerList)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_LineAttributes, OpenGl_Resource)
-// =======================================================================
-// function : OpenGl_LineAttributes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_LineAttributes::OpenGl_LineAttributes()
{
//
}
-// =======================================================================
-// function : ~OpenGl_LineAttributes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_LineAttributes::~OpenGl_LineAttributes()
{
Release(NULL);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_LineAttributes::Release(OpenGl_Context* theGlCtx)
{
if (theGlCtx != NULL && theGlCtx->IsValid())
myStyles.Clear();
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int OpenGl_LineAttributes::init(const OpenGl_Context* theGlCtx,
const Handle(Graphic3d_HatchStyle)& theStyle)
{
return aListId;
}
-// =======================================================================
-// function : SetTypeOfHatch
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_LineAttributes::SetTypeOfHatch(const OpenGl_Context* theGlCtx,
const Handle(Graphic3d_HatchStyle)& theStyle)
{
Graphic3d_Vec4 myClearColor;
};
-// =======================================================================
-// function : Create
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(OpenGl_PBREnvironment) OpenGl_PBREnvironment::Create(const Handle(OpenGl_Context)& theCtx,
unsigned int thePow2Size,
unsigned int theLevelsNumber,
return anEnvironment;
}
-// =======================================================================
-// function : OpenGl_PBREnvironment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_PBREnvironment::OpenGl_PBREnvironment(const Handle(OpenGl_Context)& theCtx,
unsigned int thePowOf2Size,
unsigned int theSpecMapLevelsNumber,
}
}
-// =======================================================================
-// function : Bind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PBREnvironment::Bind(const Handle(OpenGl_Context)& theCtx)
{
myIBLMaps[OpenGl_TypeOfIBLMap_DiffuseSH].Bind(theCtx);
myIsNeededToBeBound = Standard_False;
}
-// =======================================================================
-// function : Unbind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PBREnvironment::Unbind(const Handle(OpenGl_Context)& theCtx)
{
myIBLMaps[OpenGl_TypeOfIBLMap_DiffuseSH].Unbind(theCtx);
myIsNeededToBeBound = Standard_True;
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PBREnvironment::Clear(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_Vec3& theColor)
{
clear(theCtx, theColor);
}
-// =======================================================================
-// function : Bake
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PBREnvironment::Bake(const Handle(OpenGl_Context)& theCtx,
const Handle(OpenGl_Texture)& theEnvMap,
Standard_Boolean theZIsInverted,
theProbability);
}
-// =======================================================================
-// function : SizesAreDifferent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_PBREnvironment::SizesAreDifferent(unsigned int thePow2Size,
unsigned int theSpecMapLevelsNumber) const
{
return myPow2Size != thePow2Size || mySpecMapLevelsNumber != theSpecMapLevelsNumber;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PBREnvironment::Release(OpenGl_Context* theCtx)
{
if (myFBO != OpenGl_FrameBuffer::NO_FRAMEBUFFER)
myVBO.Release(theCtx);
}
-// =======================================================================
-// function : ~OpenGl_PBREnvironment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_PBREnvironment::~OpenGl_PBREnvironment()
{
Release(NULL);
}
-// =======================================================================
-// function : initTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_PBREnvironment::initTextures(const Handle(OpenGl_Context)& theCtx)
{
myIBLMaps[OpenGl_TypeOfIBLMap_Specular].Sampler()->Parameters()->SetTextureUnit(
return true;
}
-// =======================================================================
-// function : initVAO
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_PBREnvironment::initVAO(const Handle(OpenGl_Context)& theCtx)
{
const float aVertexPos[] =
return myVBO.Init(theCtx, 4, 4, aVertexPos);
}
-// =======================================================================
-// function : initFBO
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_PBREnvironment::initFBO(const Handle(OpenGl_Context)& theCtx)
{
theCtx->arbFBO->glGenFramebuffers(1, &myFBO);
return checkFBOComplentess(theCtx);
}
-// =======================================================================
-// function : processDiffIBLMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_PBREnvironment::processDiffIBLMap(const Handle(OpenGl_Context)& theCtx,
const BakingParams* theDrawParams)
{
return true;
}
-// =======================================================================
-// function : processSpecIBLMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_PBREnvironment::processSpecIBLMap(const Handle(OpenGl_Context)& theCtx,
const BakingParams* theDrawParams)
{
return true;
}
-// =======================================================================
-// function : checkFBOCompletness
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_PBREnvironment::checkFBOComplentess(const Handle(OpenGl_Context)& theCtx)
{
myCanRenderFloat = true;
return true;
}
-// =======================================================================
-// function : bake
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PBREnvironment::bake(const Handle(OpenGl_Context)& theCtx,
const Handle(OpenGl_Texture)& theEnvMap,
Standard_Boolean theZIsInverted,
theEnvMap->Unbind(theCtx, theCtx->PBREnvLUTTexUnit());
}
-// =======================================================================
-// function : clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PBREnvironment::clear(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_Vec3& theColor)
{
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_PointSprite, OpenGl_Texture)
-// =======================================================================
-// function : OpenGl_PointSprite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_PointSprite::OpenGl_PointSprite(const TCollection_AsciiString& theResourceId)
: OpenGl_Texture(theResourceId, Handle(Graphic3d_TextureParams)()),
myBitmapList(0)
Graphic3d_Vec4(0.0f, 0.0f, 0.0f, 0.0f));
}
-// =======================================================================
-// function : ~OpenGl_PointSprite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_PointSprite::~OpenGl_PointSprite()
{
Release(NULL);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PointSprite::Release(OpenGl_Context* theGlCtx)
{
if (myBitmapList != 0)
OpenGl_Texture::Release(theGlCtx);
}
-// =======================================================================
-// function : SetDisplayList
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PointSprite::SetDisplayList(const Handle(OpenGl_Context)& theCtx,
const GLuint theBitmapList)
{
myBitmapList = theBitmapList;
}
-// =======================================================================
-// function : DrawBitmap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PointSprite::DrawBitmap(const Handle(OpenGl_Context)& theCtx) const
{
if (myBitmapList != 0)
Standard_Integer Stride;
};
-// =======================================================================
-// function : clearMemoryGL
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::clearMemoryGL(const Handle(OpenGl_Context)& theGlCtx) const
{
if (!myVboIndices.IsNull())
}
}
-// =======================================================================
-// function : initNormalVbo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_PrimitiveArray::initNormalVbo(const Handle(OpenGl_Context)& theCtx) const
{
switch (myAttribs->NbAttributes)
return Standard_True;
}
-// =======================================================================
-// function : buildVBO
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_PrimitiveArray::buildVBO(const Handle(OpenGl_Context)& theCtx,
const Standard_Boolean theToKeepData) const
{
return Standard_True;
}
-// =======================================================================
-// function : updateVBO
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::updateVBO(const Handle(OpenGl_Context)& theCtx) const
{
if (!myAttribs.IsNull())
}
}
-// =======================================================================
-// function : drawArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::drawArray(const Handle(OpenGl_Workspace)& theWorkspace,
const Graphic3d_Vec4* theFaceColors,
const Standard_Boolean theHasVertColor) const
myVboAttribs->UnbindAllAttributes(aGlContext);
}
-// =======================================================================
-// function : drawEdges
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::drawEdges(const Handle(OpenGl_Workspace)& theWorkspace) const
{
const Handle(OpenGl_Context)& aGlContext = theWorkspace->GetGlContext();
aGlContext->SetPolygonMode(aPolyModeOld);
}
-// =======================================================================
-// function : drawMarkers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::drawMarkers(const Handle(OpenGl_Workspace)& theWorkspace) const
{
const OpenGl_Aspects* anAspectMarker = theWorkspace->Aspects();
}
}
-// =======================================================================
-// function : OpenGl_PrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_PrimitiveArray::OpenGl_PrimitiveArray(const OpenGl_GraphicDriver* theDriver)
: myDrawMode(DRAW_MODE_NONE),
}
}
-// =======================================================================
-// function : OpenGl_PrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_PrimitiveArray::OpenGl_PrimitiveArray(const OpenGl_GraphicDriver* theDriver,
const Graphic3d_TypeOfPrimitiveArray theType,
const Handle(Graphic3d_IndexBuffer)& theIndices,
setDrawMode(theType);
}
-// =======================================================================
-// function : ~OpenGl_PrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_PrimitiveArray::~OpenGl_PrimitiveArray()
{
//
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::Release(OpenGl_Context* theContext)
{
myIsVboInit = Standard_False;
}
}
-// =======================================================================
-// function : EstimatedDataSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_PrimitiveArray::EstimatedDataSize() const
{
Standard_Size aSize = 0;
return aSize;
}
-// =======================================================================
-// function : UpdateDrawStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::UpdateDrawStats(Graphic3d_FrameStatsDataTmp& theStats,
bool theIsDetailed) const
{
}
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
if (myDrawMode == DRAW_MODE_NONE)
}
}
-// =======================================================================
-// function : setDrawMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::setDrawMode(const Graphic3d_TypeOfPrimitiveArray theType)
{
if (myAttribs.IsNull())
}
}
-// =======================================================================
-// function : processIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_PrimitiveArray::processIndices(
const Handle(OpenGl_Context)& theContext) const
{
return Standard_True;
}
-// =======================================================================
-// function : InitBuffers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::InitBuffers(const Handle(OpenGl_Context)& theContext,
const Graphic3d_TypeOfPrimitiveArray theType,
const Handle(Graphic3d_IndexBuffer)& theIndices,
setDrawMode(theType);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_PrimitiveArray::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_PrimitiveArray)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Sampler, OpenGl_Resource)
-// =======================================================================
-// function : OpenGl_Sampler
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Sampler::OpenGl_Sampler(const Handle(Graphic3d_TextureParams)& theParams)
: myParams(theParams),
mySamplerRevision(0),
}
}
-// =======================================================================
-// function : ~OpenGl_Sampler
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Sampler::~OpenGl_Sampler()
{
Release(NULL);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Sampler::Release(OpenGl_Context* theCtx)
{
myIsImmutable = false;
mySamplerID = NO_SAMPLER;
}
-// =======================================================================
-// function : Create
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Sampler::Create(const Handle(OpenGl_Context)& theCtx)
{
if (isValidSampler())
return Standard_True;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Sampler::Init(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Texture& theTexture)
{
}
}
-// =======================================================================
-// function : setParameter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Sampler::setParameter(const Handle(OpenGl_Context)& theCtx,
OpenGl_Sampler* theSampler,
unsigned int theTarget,
}
}
-// =======================================================================
-// function : SetParameters
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Sampler::SetParameters(const Handle(Graphic3d_TextureParams)& theParams)
{
if (myParams != theParams)
}
}
-// =======================================================================
-// function : applySamplerParams
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Sampler::applySamplerParams(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_TextureParams)& theParams,
OpenGl_Sampler* theSampler,
}
}
-// =======================================================================
-// function : applyGlobalTextureParams
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Sampler::applyGlobalTextureParams(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Texture& theTexture,
const Handle(Graphic3d_TextureParams)& theParams)
}
}
-// =======================================================================
-// function : resetGlobalTextureParams
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Sampler::resetGlobalTextureParams(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Texture& theTexture,
const Handle(Graphic3d_TextureParams)& theParams)
}
}
-// =======================================================================
-// function : clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::clear()
{
myProgramList.Clear();
}
}
-// =======================================================================
-// function : switchLightPrograms
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::switchLightPrograms()
{
const Handle(Graphic3d_LightSet)& aLights = myLightSourceState.LightSources();
}
}
-// =======================================================================
-// function : UpdateSRgbState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::UpdateSRgbState()
{
if (mySRgbState == myContext->ToRenderSRGB())
switchLightPrograms();
}
-// =======================================================================
-// function : UpdateLightSourceState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::UpdateLightSourceState()
{
myLightSourceState.Update();
}
-// =======================================================================
-// function : SetShadingModel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::SetShadingModel(const Graphic3d_TypeOfShadingModel theModel)
{
if (theModel == Graphic3d_TypeOfShadingModel_DEFAULT)
myWorldViewState.Update();
}
-// =======================================================================
-// function : pushLightSourceState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::pushLightSourceState(
const Handle(OpenGl_ShaderProgram)& theProgram) const
{
}
}
-// =======================================================================
-// function : pushProjectionState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::pushProjectionState(const Handle(OpenGl_ShaderProgram)& theProgram) const
{
theProgram->UpdateState(OpenGl_PROJECTION_STATE, myProjectionState.Index());
}
}
-// =======================================================================
-// function : pushModelWorldState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::pushModelWorldState(const Handle(OpenGl_ShaderProgram)& theProgram) const
{
theProgram->UpdateState(OpenGl_MODEL_WORLD_STATE, myModelWorldState.Index());
}
}
-// =======================================================================
-// function : pushWorldViewState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::pushWorldViewState(const Handle(OpenGl_ShaderProgram)& theProgram) const
{
if (myWorldViewState.Index() == theProgram->ActiveState(OpenGl_WORLD_VIEW_STATE))
myClippingState.Revert();
}
-// =======================================================================
-// function : pushClippingState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::pushClippingState(const Handle(OpenGl_ShaderProgram)& theProgram) const
{
theProgram->UpdateState(OpenGl_CLIP_PLANES_STATE, myClippingState.Index());
&myClipChainArray.First());
}
-// =======================================================================
-// function : pushMaterialState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::pushMaterialState(const Handle(OpenGl_ShaderProgram)& theProgram) const
{
const OpenGl_Material& aMat = myMaterialState.Material();
}
}
-// =======================================================================
-// function : pushOitState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::pushOitState(const Handle(OpenGl_ShaderProgram)& theProgram) const
{
if (const OpenGl_ShaderUniformLocation& aLocOutput =
}
}
-// =======================================================================
-// function : PushInteriorState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderManager::PushInteriorState(const Handle(OpenGl_ShaderProgram)& theProgram,
const Handle(Graphic3d_Aspects)& theAspect) const
{
}
}
-// =======================================================================
-// function : BindFontProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::BindFontProgram(
const Handle(OpenGl_ShaderProgram)& theCustomProgram)
{
return bindProgramWithState(myFontProgram, Graphic3d_TypeOfShadingModel_Unlit);
}
-// =======================================================================
-// function : BindFboBlitProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::BindFboBlitProgram(Standard_Integer theNbSamples,
Standard_Boolean theIsFallback_sRGB)
{
return true;
}
-// =======================================================================
-// function : BindOitCompositingProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::BindOitCompositingProgram(Standard_Boolean theIsMSAAEnabled)
{
const Standard_Integer aProgramIdx = theIsMSAAEnabled ? 1 : 0;
return true;
}
-// =======================================================================
-// function : BindOitDepthPeelingBlendProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::BindOitDepthPeelingBlendProgram(bool theIsMSAAEnabled)
{
const Standard_Integer aProgramIdx = theIsMSAAEnabled ? 1 : 0;
return true;
}
-// =======================================================================
-// function : BindOitDepthPeelingFlushProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::BindOitDepthPeelingFlushProgram(bool theIsMSAAEnabled)
{
const Standard_Integer aProgramIdx = theIsMSAAEnabled ? 1 : 0;
return true;
}
-// =======================================================================
-// function : prepareStdProgramUnlit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::prepareStdProgramUnlit(
Handle(OpenGl_ShaderProgram)& theProgram,
Standard_Integer theBits,
return Standard_True;
}
-// =======================================================================
-// function : prepareStdProgramGouraud
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::prepareStdProgramGouraud(
Handle(OpenGl_ShaderProgram)& theProgram,
const Standard_Integer theBits)
return Standard_True;
}
-// =======================================================================
-// function : prepareStdProgramPhong
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::prepareStdProgramPhong(
Handle(OpenGl_ShaderProgram)& theProgram,
const Standard_Integer theBits,
return Standard_True;
}
-// =======================================================================
-// function : BindStereoProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::BindStereoProgram(Graphic3d_StereoMode theStereoMode)
{
if (theStereoMode < 0 || (int)theStereoMode >= Graphic3d_StereoMode_NB)
return true;
}
-// =======================================================================
-// function : prepareStdProgramBoundBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::prepareStdProgramBoundBox()
{
Handle(Graphic3d_ShaderProgram) aProgramSrc = Graphic3d_ShaderManager::getStdProgramBoundBox();
return Standard_True;
}
-// =======================================================================
-// function : preparePBREnvBakingProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::preparePBREnvBakingProgram(Standard_Integer theIndex)
{
Handle(Graphic3d_ShaderProgram) aProgramSrc = getPBREnvBakingProgram(theIndex);
return Standard_True;
}
-// =======================================================================
-// function : GetBgCubeMapProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Graphic3d_ShaderProgram)& OpenGl_ShaderManager::GetBgCubeMapProgram()
{
if (myBgCubeMapProgram.IsNull())
return myBgCubeMapProgram;
}
-// =======================================================================
-// function : GetBgSkydomeProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Graphic3d_ShaderProgram)& OpenGl_ShaderManager::GetBgSkydomeProgram()
{
if (myBgSkydomeProgram.IsNull())
return myBgSkydomeProgram;
}
-// =======================================================================
-// function : GetColoredQuadProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Graphic3d_ShaderProgram)& OpenGl_ShaderManager::GetColoredQuadProgram()
{
if (myColoredQuadProgram.IsNull())
return myColoredQuadProgram;
}
-// =======================================================================
-// function : bindProgramWithState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::bindProgramWithState(
const Handle(OpenGl_ShaderProgram)& theProgram,
Graphic3d_TypeOfShadingModel theShadingModel)
return isBound;
}
-// =======================================================================
-// function : BindMarkerProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderManager::BindMarkerProgram(
const Handle(OpenGl_TextureSet)& theTextures,
Graphic3d_TypeOfShadingModel theShadingModel,
Release(NULL);
}
-// =======================================================================
-// function : LoadAndCompile
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderObject::LoadAndCompile(const Handle(OpenGl_Context)& theCtx,
const TCollection_AsciiString& theId,
const TCollection_AsciiString& theSource,
return true;
}
-// =======================================================================
-// function : DumpSourceCode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShaderObject::DumpSourceCode(const Handle(OpenGl_Context)& theCtx,
const TCollection_AsciiString& theId,
const TCollection_AsciiString& theSource) const
return true;
}
-// =======================================================================
-// function : updateDebugDump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderObject::updateDebugDump(const Handle(OpenGl_Context)& theCtx,
const TCollection_AsciiString& theProgramId,
const TCollection_AsciiString& theFolder,
return Standard_True;
}
-// =======================================================================
-// function : Link
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::Link(const Handle(OpenGl_Context)& theCtx, bool theIsVerbose)
{
if (!theIsVerbose)
return Standard_True;
}
-// =======================================================================
-// function : SetAttributeName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetAttributeName(const Handle(OpenGl_Context)& theCtx,
GLint theIndex,
const GLchar* theName)
return Standard_True;
}
-// =======================================================================
-// function : SetAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetAttribute(const Handle(OpenGl_Context)& theCtx,
GLint theIndex,
GLfloat theValue)
return Standard_True;
}
-// =======================================================================
-// function : SetAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetAttribute(const Handle(OpenGl_Context)& theCtx,
GLint theIndex,
const OpenGl_Vec2& theValue)
return Standard_True;
}
-// =======================================================================
-// function : SetAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetAttribute(const Handle(OpenGl_Context)& theCtx,
GLint theIndex,
const OpenGl_Vec3& theValue)
return Standard_True;
}
-// =======================================================================
-// function : SetAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetAttribute(const Handle(OpenGl_Context)& theCtx,
GLint theIndex,
const OpenGl_Vec4& theValue)
return Standard_True;
}
-// =======================================================================
-// function : SetUniform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetUniform(const Handle(OpenGl_Context)& theCtx,
GLint theLocation,
const OpenGl_Vec2u& theValue)
return false;
}
-// =======================================================================
-// function : SetUniform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetUniform(const Handle(OpenGl_Context)& theCtx,
const GLchar* theName,
const GLsizei theCount,
return SetUniform(theCtx, GetUniformLocation(theCtx, theName), theCount, theValue);
}
-// =======================================================================
-// function : SetUniform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetUniform(const Handle(OpenGl_Context)& theCtx,
GLint theLocation,
const GLsizei theCount,
return Standard_True;
}
-// =======================================================================
-// function : SetUniform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetUniform(const Handle(OpenGl_Context)& theCtx,
GLint theLocation,
GLuint theCount,
return Standard_True;
}
-// =======================================================================
-// function : SetUniform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::SetUniform(const Handle(OpenGl_Context)& theCtx,
GLint theLocation,
GLuint theCount,
myProgramID = NO_PROGRAM;
}
-// =======================================================================
-// function : UpdateDebugDump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_ShaderProgram::UpdateDebugDump(const Handle(OpenGl_Context)& theCtx,
const TCollection_AsciiString& theFolder,
Standard_Boolean theToBeautify,
#include <OpenGl_ShaderStates.hxx>
-// =======================================================================
-// function : OpenGl_StateInterface
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_StateInterface::OpenGl_StateInterface()
: myIndex(0)
{
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_ShadowMap, OpenGl_NamedResource)
-// =======================================================================
-// function : OpenGl_ShadowMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_ShadowMap::OpenGl_ShadowMap()
: OpenGl_NamedResource("shadow_map"),
myShadowMapFbo(new OpenGl_FrameBuffer(myResourceId + ":fbo")),
//
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShadowMap::Release(OpenGl_Context* theCtx)
{
myShadowMapFbo->Release(theCtx);
}
-// =======================================================================
-// function : ~OpenGl_ShadowMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_ShadowMap::~OpenGl_ShadowMap()
{
Release(NULL);
}
-// =======================================================================
-// function : EstimatedDataSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_ShadowMap::EstimatedDataSize() const
{
return myShadowMapFbo->EstimatedDataSize();
}
-// =======================================================================
-// function : IsValid
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_ShadowMap::IsValid() const
{
return myShadowMapFbo->IsValid();
}
-// =======================================================================
-// function : Texture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(OpenGl_Texture)& OpenGl_ShadowMap::Texture() const
{
return myShadowMapFbo->DepthStencilTexture();
}
-// =======================================================================
-// function : UpdateCamera
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_ShadowMap::UpdateCamera(const Graphic3d_CView& theView, const gp_XYZ* theOrigin)
{
// clang-format off
return false;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_ShadowMapArray::Release(OpenGl_Context* theCtx)
{
for (Standard_Integer anIter = Lower(); anIter <= Upper(); ++anIter)
}
}
-// =======================================================================
-// function : EstimatedDataSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_ShadowMapArray::EstimatedDataSize() const
{
Standard_Size aSize = 0;
//
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_StencilTest::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
}
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_StencilTest::Release(OpenGl_Context*)
{
//
}
-// =======================================================================
-// function : SetStencilTestState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_StencilTest::SetOptions(const Standard_Boolean theIsEnabled)
{
myIsEnabled = theIsEnabled;
}
-// =======================================================================
-// function : ~OpenGl_StencilTest
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_StencilTest::~OpenGl_StencilTest()
{
//
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_StencilTest::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_StencilTest)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Structure, Graphic3d_CStructure)
-// =======================================================================
-// function : renderBoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::renderBoundingBox(const Handle(OpenGl_Workspace)& theWorkspace) const
{
if (!myBndBox.IsValid())
aCtx->BindTextures(aPrevTexture, Handle(OpenGl_ShaderProgram)());
}
-// =======================================================================
-// function : OpenGl_Structure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Structure::OpenGl_Structure(const Handle(Graphic3d_StructureManager)& theManager)
: Graphic3d_CStructure(theManager),
myInstancedStructure(NULL),
updateLayerTransformation();
}
-// =======================================================================
-// function : ~OpenGl_Structure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Structure::~OpenGl_Structure()
{
Release(Handle(OpenGl_Context)());
}
-// =======================================================================
-// function : SetZLayer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::SetZLayer(const Graphic3d_ZLayerId theLayerIndex)
{
Graphic3d_CStructure::SetZLayer(theLayerIndex);
updateLayerTransformation();
}
-// =======================================================================
-// function : SetTransformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::SetTransformation(const Handle(TopLoc_Datum3D)& theTrsf)
{
myTrsf = theTrsf;
}
}
-// =======================================================================
-// function : SetTransformPersistence
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::SetTransformPersistence(const Handle(Graphic3d_TransformPers)& theTrsfPers)
{
if ((myTrsfPers.IsNull() || theTrsfPers.IsNull()) && myTrsfPers != theTrsfPers)
updateLayerTransformation();
}
-// =======================================================================
-// function : updateLayerTransformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::updateLayerTransformation()
{
gp_Trsf aRenderTrsf;
aRenderTrsf.GetMat4(myRenderTrsf);
}
-// =======================================================================
-// function : GraphicHighlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::GraphicHighlight(const Handle(Graphic3d_PresentationAttributes)& theStyle)
{
myHighlightStyle = theStyle;
highlight = 1;
}
-// =======================================================================
-// function : GraphicUnhighlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::GraphicUnhighlight()
{
highlight = 0;
myHighlightStyle.Nullify();
}
-// =======================================================================
-// function : OnVisibilityChanged
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::OnVisibilityChanged()
{
if (IsRaytracable())
}
}
-// =======================================================================
-// function : IsRaytracable
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Structure::IsRaytracable() const
{
if (!myGroups.IsEmpty() && myIsRaytracable && myTrsfPers.IsNull())
return myInstancedStructure != NULL && myInstancedStructure->IsRaytracable();
}
-// =======================================================================
-// function : UpdateRaytracableState
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::UpdateStateIfRaytracable(const Standard_Boolean toCheck) const
{
myIsRaytracable = !toCheck;
}
}
-// =======================================================================
-// function : Connect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::Connect(Graphic3d_CStructure& theStructure)
{
OpenGl_Structure* aStruct = static_cast<OpenGl_Structure*>(&theStructure);
}
}
-// =======================================================================
-// function : Disconnect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::Disconnect(Graphic3d_CStructure& theStructure)
{
OpenGl_Structure* aStruct = static_cast<OpenGl_Structure*>(&theStructure);
}
}
-// =======================================================================
-// function : NewGroup
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_Group) OpenGl_Structure::NewGroup(const Handle(Graphic3d_Structure)& theStruct)
{
Handle(OpenGl_Group) aGroup = new OpenGl_Group(theStruct);
return aGroup;
}
-// =======================================================================
-// function : RemoveGroup
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::RemoveGroup(const Handle(Graphic3d_Group)& theGroup)
{
if (theGroup.IsNull())
}
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::Clear()
{
Clear(GlDriver()->GetSharedContext());
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::Clear(const Handle(OpenGl_Context)& theGlCtx)
{
Standard_Boolean aRaytracableGroupDeleted(Standard_False);
IsForHighlight = Standard_False;
}
-// =======================================================================
-// function : renderGeometry
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::renderGeometry(const Handle(OpenGl_Workspace)& theWorkspace,
bool& theHasClosed) const
{
}
}
-// =======================================================================
-// function : applyTransformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::applyTransformation(const Handle(OpenGl_Context)& theContext,
const gp_Trsf& theTrsf,
const Standard_Boolean toEnable) const
}
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
// Process the structure only if visible
theWorkspace->SetHighlightStyle(Handle(Graphic3d_PresentationAttributes)());
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::Release(const Handle(OpenGl_Context)& theGlCtx)
{
// Release groups
myHighlightStyle.Nullify();
}
-// =======================================================================
-// function : ReleaseGlResources
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::ReleaseGlResources(const Handle(OpenGl_Context)& theGlCtx)
{
for (OpenGl_Structure::GroupIterator aGroupIter(myGroups); aGroupIter.More(); aGroupIter.Next())
return new OpenGl_StructureShadow(theManager, this);
}
-// =======================================================================
-// function : applyPersistence
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::applyPersistence(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_TransformPers)& theTrsfPers,
const Standard_Boolean theIsLocal,
}
}
-// =======================================================================
-// function : revertPersistence
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Structure::revertPersistence(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_TransformPers)& theTrsfPers,
const Standard_Boolean theIsLocal,
myInstancedStructure = myParent.operator->();
}
-// =======================================================================
-// function : Connect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_StructureShadow::Connect(Graphic3d_CStructure&)
{
throw Standard_ProgramError("Error! OpenGl_StructureShadow::Connect() should not be called!");
}
-// =======================================================================
-// function : Disconnect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_StructureShadow::Disconnect(Graphic3d_CStructure&)
{
throw Standard_ProgramError("Error! OpenGl_StructureShadow::Disconnect() should not be called!");
} // anonymous namespace
-// =======================================================================
-// function : OpenGl_Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Text::OpenGl_Text()
: myScaleHeight(1.0f),
myIs2d(Standard_False)
myText = new Graphic3d_Text(10.);
}
-// =======================================================================
-// function : OpenGl_Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Text::OpenGl_Text(const Handle(Graphic3d_Text)& theTextParams)
: myText(theTextParams),
myScaleHeight(1.0f),
{
}
-// =======================================================================
-// function : SetPosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::SetPosition(const OpenGl_Vec3& thePoint)
{
myText->SetPosition(gp_Pnt(thePoint.x(), thePoint.y(), thePoint.z()));
}
-// =======================================================================
-// function : SetFontSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::SetFontSize(const Handle(OpenGl_Context)& theCtx,
const Standard_Integer theFontSize)
{
myText->SetHeight((Standard_ShortReal)theFontSize);
}
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::Reset(const Handle(OpenGl_Context)& theCtx)
{
if (!myFont.IsNull() && myFont->FTFont()->PointSize() != myText->Height())
}
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::Init(const Handle(OpenGl_Context)& theCtx,
const Standard_Utf8Char* theText,
const OpenGl_Vec3& thePoint)
myText->SetPosition(gp_Pnt(thePoint.x(), thePoint.y(), thePoint.z()));
}
-// =======================================================================
-// function : ~OpenGl_Text
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Text::~OpenGl_Text()
{
//
}
-// =======================================================================
-// function : releaseVbos
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::releaseVbos(OpenGl_Context* theCtx)
{
for (Standard_Integer anIter = 0; anIter < myVertsVbo.Length(); ++anIter)
myBndVertsVbo.Nullify();
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::Release(OpenGl_Context* theCtx)
{
releaseVbos(theCtx);
}
}
-// =======================================================================
-// function : EstimatedDataSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_Text::EstimatedDataSize() const
{
Standard_Size aSize = 0;
return aSize;
}
-// =======================================================================
-// function : UpdateDrawStats
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::UpdateDrawStats(Graphic3d_FrameStatsDataTmp& theStats, bool theIsDetailed) const
{
++theStats[Graphic3d_FrameStatsCounter_NbElemsNotCulled];
}
}
-// =======================================================================
-// function : StringSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::StringSize(const Handle(OpenGl_Context)& theCtx,
const NCollection_String& theText,
const OpenGl_Aspects& theTextAspect,
aCtx->ReleaseResource(aFontKey, Standard_True);
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::Render(const Handle(OpenGl_Workspace)& theWorkspace) const
{
// clang-format off
}
}
-// =======================================================================
-// function : Render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::Render(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Aspects& theTextAspect,
unsigned int theResolution,
theCtx->SetPolygonHatchEnabled(aPrevHatchingMode);
}
-// =======================================================================
-// function : setupMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::setupMatrix(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Aspects& theTextAspect,
const OpenGl_Vec3& theDVec) const
theCtx->ShaderManager()->PushState(theCtx->ActiveProgram());
}
-// =======================================================================
-// function : drawText
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::drawText(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Aspects& theTextAspect) const
{
theCtx->core11fwd->glBindTexture(GL_TEXTURE_2D, 0);
}
-// =======================================================================
-// function : FontKey
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_Text::FontKey(const OpenGl_Aspects& theAspect,
Standard_Integer theHeight,
unsigned int theResolution,
return aFont + aSuff;
}
-// =======================================================================
-// function : FindFont
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(OpenGl_Font) OpenGl_Text::FindFont(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Aspects& theAspect,
Standard_Integer theHeight,
return aFont;
}
-// =======================================================================
-// function : drawRect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::drawRect(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Aspects& theTextAspect,
const OpenGl_Vec4& theColorSubs) const
theCtx->BindProgram(aPrevProgram);
}
-// =======================================================================
-// function : render
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::render(const Handle(OpenGl_Context)& theCtx,
const OpenGl_Aspects& theTextAspect,
const OpenGl_Vec4& theColorText,
theCtx->ApplyModelViewMatrix();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Text::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_CLASS_BEGIN(theOStream, OpenGl_Text)
}
} // namespace
-// =======================================================================
-// function : OpenGl_TextBuilder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_TextBuilder::OpenGl_TextBuilder()
{
//
}
-// =======================================================================
-// function : createGlyphs
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_TextBuilder::createGlyphs(
const Handle(Font_TextFormatter)& theFormatter,
const Handle(OpenGl_Context)& theCtx,
}
}
-// =======================================================================
-// function : CreateTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_TextBuilder::Perform(
const Handle(Font_TextFormatter)& theFormatter,
const Handle(OpenGl_Context)& theCtx,
} // namespace
-// =======================================================================
-// function : OpenGl_Texture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Texture::OpenGl_Texture(const TCollection_AsciiString& theResourceId,
const Handle(Graphic3d_TextureParams)& theParams)
: OpenGl_NamedResource(theResourceId),
//
}
-// =======================================================================
-// function : ~OpenGl_Texture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Texture::~OpenGl_Texture()
{
Release(NULL);
}
-// =======================================================================
-// function : Create
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::Create(const Handle(OpenGl_Context)& theCtx)
{
if (myTextureId != NO_TEXTURE)
return true;
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Texture::Release(OpenGl_Context* theGlCtx)
{
mySampler->Release(theGlCtx);
mySize.SetValues(0, 0, 0);
}
-// =======================================================================
-// function : applyDefaultSamplerParams
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Texture::applyDefaultSamplerParams(const Handle(OpenGl_Context)& theCtx)
{
OpenGl_Sampler::applySamplerParams(theCtx,
}
}
-// =======================================================================
-// function : Bind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Texture::Bind(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_TextureUnit theTextureUnit) const
{
theCtx->core11fwd->glBindTexture(myTarget, myTextureId);
}
-// =======================================================================
-// function : Unbind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Texture::Unbind(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_TextureUnit theTextureUnit) const
{
return myTextureId != NO_TEXTURE && mySampler->Init(theCtx, *this);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::Init(const Handle(OpenGl_Context)& theCtx,
const OpenGl_TextureFormat& theFormat,
const Graphic3d_Vec3i& theSizeXYZ,
return true;
}
-// =======================================================================
-// function : GenerateMipmaps
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::GenerateMipmaps(const Handle(OpenGl_Context)& theCtx)
{
if (theCtx->arbFBO == nullptr || !IsValid())
return true;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::Init(const Handle(OpenGl_Context)& theCtx,
const Image_PixMap& theImage,
const Graphic3d_TypeOfTexture theType,
return Init(theCtx, aFormat, Graphic3d_Vec3i(theImage.SizeXYZ()), theType, &theImage);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::Init(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_TextureRoot)& theTextureMap)
{
}
}
-// =======================================================================
-// function : InitCompressed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::InitCompressed(const Handle(OpenGl_Context)& theCtx,
const Image_CompressedPixMap& theImage,
const Standard_Boolean theIsColorMap)
return true;
}
-// =======================================================================
-// function : Init2DMultisample
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::Init2DMultisample(const Handle(OpenGl_Context)& theCtx,
const Standard_Integer theNbSamples,
const Standard_Integer theTextFormat,
return true;
}
-// =======================================================================
-// function : InitRectangle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::InitRectangle(const Handle(OpenGl_Context)& theCtx,
const Standard_Integer theSizeX,
const Standard_Integer theSizeY,
return true;
}
-// =======================================================================
-// function : Init3D
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::Init3D(const Handle(OpenGl_Context)& theCtx,
const OpenGl_TextureFormat& theFormat,
const Graphic3d_Vec3i& theSizeXYZ,
return true;
}
-// =======================================================================
-// function : InitCubeMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::InitCubeMap(const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_CubeMap)& theCubeMap,
Standard_Size theSize,
return true;
}
-// =======================================================================
-// function : PixelSizeOfPixelFormat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_Texture::PixelSizeOfPixelFormat(Standard_Integer theInternalFormat)
{
switch (theInternalFormat)
return 1;
}
-// =======================================================================
-// function : EstimatedDataSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Size OpenGl_Texture::EstimatedDataSize() const
{
if (!IsValid())
return aSize;
}
-// =======================================================================
-// function : ImageDump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Texture::ImageDump(Image_PixMap& theImage,
const Handle(OpenGl_Context)& theCtx,
Graphic3d_TextureUnit theTexUnit,
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_TextureBuffer, OpenGl_Buffer)
-// =======================================================================
-// function : OpenGl_TextureBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_TextureBuffer::OpenGl_TextureBuffer()
: OpenGl_Buffer(),
myTextureId(NO_TEXTURE),
//
}
-// =======================================================================
-// function : ~OpenGl_TextureBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_TextureBuffer::~OpenGl_TextureBuffer()
{
Release(NULL);
}
-// =======================================================================
-// function : GetTarget
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int OpenGl_TextureBuffer::GetTarget() const
{
return GL_TEXTURE_BUFFER; // GL_TEXTURE_BUFFER for OpenGL 3.1+, OpenGL ES 3.2
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_TextureBuffer::Release(OpenGl_Context* theGlCtx)
{
if (myTextureId != NO_TEXTURE)
base_type::Release(theGlCtx);
}
-// =======================================================================
-// function : Create
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureBuffer::Create(const Handle(OpenGl_Context)& theGlCtx)
{
if (!base_type::Create(theGlCtx))
return myTextureId != NO_TEXTURE;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureBuffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return true;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureBuffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return true;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureBuffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return true;
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureBuffer::Init(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theComponentsNb,
const Standard_Integer theElemsNb,
return true;
}
-// =======================================================================
-// function : BindTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_TextureBuffer::BindTexture(const Handle(OpenGl_Context)& theGlCtx,
const Graphic3d_TextureUnit theTextureUnit) const
{
theGlCtx->core20fwd->glBindTexture(GetTarget(), myTextureId);
}
-// =======================================================================
-// function : UnbindTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_TextureBuffer::UnbindTexture(const Handle(OpenGl_Context)& theGlCtx,
const Graphic3d_TextureUnit theTextureUnit) const
{
#include <Image_SupportedFormats.hxx>
#include <OpenGl_Context.hxx>
-// =======================================================================
-// function : FormatFormat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_TextureFormat::FormatFormat(GLint theInternalFormat)
{
switch (theInternalFormat)
return OpenGl_Context::FormatGlEnumHex(theInternalFormat);
}
-// =======================================================================
-// function : FormatDataType
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString OpenGl_TextureFormat::FormatDataType(GLint theDataType)
{
switch (theDataType)
return OpenGl_Context::FormatGlEnumHex(theDataType);
}
-// =======================================================================
-// function : FindFormat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_TextureFormat OpenGl_TextureFormat::FindFormat(const Handle(OpenGl_Context)& theCtx,
Image_Format theFormat,
bool theIsColorMap)
return OpenGl_TextureFormat();
}
-// =======================================================================
-// function : FindSizedFormat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_TextureFormat OpenGl_TextureFormat::FindSizedFormat(const Handle(OpenGl_Context)& theCtx,
GLint theSizedFormat)
{
return aFormat;
}
-// =======================================================================
-// function : FindCompressedFormat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_TextureFormat OpenGl_TextureFormat::FindCompressedFormat(
const Handle(OpenGl_Context)& theCtx,
Image_CompressedFormat theFormat,
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_TextureSet, Standard_Transient)
-// =======================================================================
-// function : OpenGl_TextureSet
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_TextureSet::OpenGl_TextureSet(const Handle(OpenGl_Texture)& theTexture)
: myTextures(0, 0),
myTextureSetBits(Graphic3d_TextureSetBits_NONE)
}
}
-// =======================================================================
-// function : IsModulate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureSet::IsModulate() const
{
return myTextures.IsEmpty() || myTextures.First().Texture.IsNull()
|| myTextures.First().Texture->Sampler()->Parameters()->IsModulate();
}
-// =======================================================================
-// function : HasNonPointSprite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureSet::HasNonPointSprite() const
{
if (myTextures.IsEmpty())
return !myTextures.First().Texture.IsNull();
}
-// =======================================================================
-// function : HasPointSprite
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_TextureSet::HasPointSprite() const
{
return !myTextures.IsEmpty() && !myTextures.Last().Texture.IsNull()
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_UniformBuffer, OpenGl_Buffer)
-// =======================================================================
-// function : OpenGl_UniformBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_UniformBuffer::OpenGl_UniformBuffer()
: OpenGl_Buffer()
{
}
-// =======================================================================
-// function : GetTarget
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int OpenGl_UniformBuffer::GetTarget() const
{
return GL_UNIFORM_BUFFER;
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_VertexBuffer, OpenGl_Buffer)
-// =======================================================================
-// function : OpenGl_VertexBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_VertexBuffer::OpenGl_VertexBuffer()
{
//
}
-// =======================================================================
-// function : ~OpenGl_VertexBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_VertexBuffer::~OpenGl_VertexBuffer()
{
//
}
-// =======================================================================
-// function : GetTarget
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int OpenGl_VertexBuffer::GetTarget() const
{
return GL_ARRAY_BUFFER;
}
-// =======================================================================
-// function : BindVertexAttrib
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::BindVertexAttrib(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theAttribLoc) const
{
->glVertexAttribPointer(theAttribLoc, GLint(myComponentsNb), myDataType, GL_FALSE, 0, myOffset);
}
-// =======================================================================
-// function : UnbindVertexAttrib
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::UnbindVertexAttrib(const Handle(OpenGl_Context)& theGlCtx,
const unsigned int theAttribLoc) const
{
Unbind(theGlCtx);
}
-// =======================================================================
-// function : BindAllAttributes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::BindAllAttributes(const Handle(OpenGl_Context)&) const
{
//
}
-// =======================================================================
-// function : BindPositionAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::BindPositionAttribute(const Handle(OpenGl_Context)&) const
{
//
}
-// =======================================================================
-// function : UnbindAllAttributes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::UnbindAllAttributes(const Handle(OpenGl_Context)&) const
{
//
}
-// =======================================================================
-// function : HasColorAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_VertexBuffer::HasColorAttribute() const
{
return false;
}
-// =======================================================================
-// function : HasNormalAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_VertexBuffer::HasNormalAttribute() const
{
return false;
}
-// =======================================================================
-// function : bindAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::bindAttribute(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_TypeOfAttribute theAttribute,
const Standard_Integer theNbComp,
theOffset);
}
-// =======================================================================
-// function : unbindAttribute
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::unbindAttribute(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_TypeOfAttribute theAttribute)
{
theCtx->core20fwd->glDisableVertexAttribArray(theAttribute);
}
-// =======================================================================
-// function : bindFixed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::bindFixed(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_TypeOfAttribute theMode,
const Standard_Integer theNbComp,
}
}
-// =======================================================================
-// function : unbindFixed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::unbindFixed(const Handle(OpenGl_Context)& theCtx,
const Graphic3d_TypeOfAttribute theMode)
{
}
}
-// =======================================================================
-// function : unbindFixedColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_VertexBuffer::unbindFixedColor(const Handle(OpenGl_Context)& theCtx)
{
theCtx->core11ffp->glDisableClientState(GL_COLOR_ARRAY);
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_View, Graphic3d_CView)
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_View::OpenGl_View(const Handle(Graphic3d_StructureManager)& theMgr,
const Handle(OpenGl_GraphicDriver)& theDriver,
const Handle(OpenGl_Caps)& theCaps,
myXrSceneFbo->ColorTexture()->Sampler()->Parameters()->SetFilter(Graphic3d_TOTF_BILINEAR);
}
-// =======================================================================
-// function : Destructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_View::~OpenGl_View()
{
ReleaseGlResources(NULL); // ensure ReleaseGlResources() was called within valid context
OpenGl_Element::Destroy(NULL, myColoredQuadParams);
}
-// =======================================================================
-// function : releaseSrgbResources
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::releaseSrgbResources(const Handle(OpenGl_Context)& theCtx)
{
myRenderParams.RebuildRayTracingShaders = true;
// and re-create dynamically only frame buffers.
}
-// =======================================================================
-// function : ReleaseGlResources
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::ReleaseGlResources(const Handle(OpenGl_Context)& theCtx)
{
myGraduatedTrihedron.Release(theCtx.get());
ReleaseXR();
}
-// =======================================================================
-// function : Remove
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::Remove()
{
if (IsRemoved())
Graphic3d_CView::Remove();
}
-// =======================================================================
-// function : SetLocalOrigin
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::SetLocalOrigin(const gp_XYZ& theOrigin)
{
myLocalOrigin = theOrigin;
}
}
-// =======================================================================
-// function : SetTextureEnv
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::SetTextureEnv(const Handle(Graphic3d_TextureEnv)& theTextureEnv)
{
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
initTextureEnv(aCtx);
}
-// =======================================================================
-// function : initTextureEnv
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::initTextureEnv(const Handle(OpenGl_Context)& theContext)
{
if (myTextureEnvData.IsNull() || theContext.IsNull() || !theContext->MakeCurrent())
myTextureEnv->ChangeTextureSetBits() = Graphic3d_TextureSetBits_BaseColor;
}
-// =======================================================================
-// function : SetImmediateModeDrawToFront
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_View::SetImmediateModeDrawToFront(
const Standard_Boolean theDrawToFrontBuffer)
{
return aPrevMode;
}
-// =======================================================================
-// function : Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Aspect_Window) OpenGl_View::Window() const
{
return myWindow->SizeWindow();
}
-// =======================================================================
-// function : SetWindow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::SetWindow(const Handle(Graphic3d_CView)& theParentVIew,
const Handle(Aspect_Window)& theWindow,
const Aspect_RenderingContext theContext)
initTextureEnv(aCtx);
}
-// =======================================================================
-// function : Resized
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::Resized()
{
base_type::Resized();
}
}
-// =======================================================================
-// function : SetMinMaxValuesCallback
-// purpose :
-// =======================================================================
+//=================================================================================================
+
static void SetMinMaxValuesCallback(Graphic3d_CView* theView)
{
OpenGl_View* aView = dynamic_cast<OpenGl_View*>(theView);
}
}
-// =======================================================================
-// function : GraduatedTrihedronDisplay
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::GraduatedTrihedronDisplay(const Graphic3d_GraduatedTrihedron& theTrihedronData)
{
myGTrihedronData = theTrihedronData;
myToShowGradTrihedron = true;
}
-// =======================================================================
-// function : GraduatedTrihedronErase
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::GraduatedTrihedronErase()
{
myGraduatedTrihedron.Release(myWorkspace->GetGlContext().operator->());
myToShowGradTrihedron = false;
}
-// =======================================================================
-// function : GraduatedTrihedronMinMaxValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::GraduatedTrihedronMinMaxValues(const Graphic3d_Vec3 theMin,
const Graphic3d_Vec3 theMax)
{
myGraduatedTrihedron.SetMinMax(theMin, theMax);
}
-// =======================================================================
-// function : BufferDump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_View::BufferDump(Image_PixMap& theImage,
const Graphic3d_BufferType& theBufferType)
{
return Standard_False;
}
-// =======================================================================
-// function : GradientBackground
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_GradientBackground OpenGl_View::GradientBackground() const
{
Quantity_Color aColor1, aColor2;
myBackgrounds[Graphic3d_TOB_GRADIENT]->GradientFillMethod());
}
-// =======================================================================
-// function : SetGradientBackground
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::SetGradientBackground(const Aspect_GradientBackground& theBackground)
{
Quantity_Color aColor1, aColor2;
myBackgroundType = Graphic3d_TOB_GRADIENT;
}
-// =======================================================================
-// function : SetBackgroundImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::SetBackgroundImage(const Handle(Graphic3d_TextureMap)& theTextureMap,
Standard_Boolean theToUpdatePBREnv)
{
"OpenGl_View::SetBackgroundImage() - invalid texture map set for background");
}
-// =======================================================================
-// function : SetImageBasedLighting
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::SetImageBasedLighting(Standard_Boolean theToEnableIBL)
{
if (!theToEnableIBL || myBackgroundType != Graphic3d_TOB_CUBEMAP)
myCubeMapIBL = myCubeMapBackground;
}
-// =======================================================================
-// function : BackgroundImageStyle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_FillMethod OpenGl_View::BackgroundImageStyle() const
{
return myBackgrounds[Graphic3d_TOB_TEXTURE]->TextureFillMethod();
}
-// =======================================================================
-// function : SetBackgroundImageStyle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::SetBackgroundImageStyle(const Aspect_FillMethod theFillStyle)
{
myBackgrounds[Graphic3d_TOB_TEXTURE]->SetTextureFillMethod(theFillStyle);
}
-// =======================================================================
-// function : SpecIBLMapLevels
-// purpose :
-// =======================================================================
+//=================================================================================================
+
unsigned int OpenGl_View::SpecIBLMapLevels() const
{
return myPBREnvironment.IsNull() ? 0 : myPBREnvironment->SpecMapLevelsNumber();
myWasRedrawnGL = Standard_True;
}
-// =======================================================================
-// function : RedrawImmediate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::RedrawImmediate()
{
if (!myWorkspace->Activate())
myWasRedrawnGL = Standard_True;
}
-// =======================================================================
-// function : redraw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::redraw(const Graphic3d_Camera::Projection theProjection,
OpenGl_FrameBuffer* theReadDrawFbo,
OpenGl_FrameBuffer* theOitAccumFbo)
render(theProjection, theReadDrawFbo, theOitAccumFbo, Standard_False);
}
-// =======================================================================
-// function : redrawImmediate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_View::redrawImmediate(const Graphic3d_Camera::Projection theProjection,
OpenGl_FrameBuffer* theReadFbo,
OpenGl_FrameBuffer* theDrawFbo,
return !toCopyBackToFront;
}
-// =======================================================================
-// function : blitSubviews
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_View::blitSubviews(const Graphic3d_Camera::Projection, OpenGl_FrameBuffer* theDrawFbo)
{
const Handle(OpenGl_Context)& aCtx = myWorkspace->GetGlContext();
}
}
-// =======================================================================
-// function : InvalidateBVHData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::InvalidateBVHData(const Graphic3d_ZLayerId theLayerId)
{
myZLayers.InvalidateBVHData(theLayerId);
}
}
-// =======================================================================
-// function : Invalidate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::Invalidate()
{
myBackBufferRestored = Standard_False;
}
}
-// =======================================================================
-// function : bindDefaultFbo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::bindDefaultFbo(OpenGl_FrameBuffer* theCustomFbo)
{
Handle(OpenGl_Context) aCtx = myWorkspace->GetGlContext();
}
}
-// =======================================================================
-// function : initBlitQuad
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_VertexBuffer* OpenGl_View::initBlitQuad(const Standard_Boolean theToFlip)
{
OpenGl_VertexBuffer* aVerts = NULL;
return aVerts;
}
-// =======================================================================
-// function : blitBuffers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_View::blitBuffers(OpenGl_FrameBuffer* theReadFbo,
OpenGl_FrameBuffer* theDrawFbo,
const Standard_Boolean theToFlip)
return true;
}
-// =======================================================================
-// function : drawStereoPair
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::drawStereoPair(OpenGl_FrameBuffer* theDrawFbo)
{
const Handle(OpenGl_Context)& aCtx = myWorkspace->GetGlContext();
aPair[0]->ColorTexture()->Unbind(aCtx, Graphic3d_TextureUnit_0);
}
-// =======================================================================
-// function : copyBackToFront
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_View::copyBackToFront()
{
myIsImmediateDrawn = Standard_False;
return true;
}
-// =======================================================================
-// function : checkOitCompatibility
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_View::checkOitCompatibility(const Handle(OpenGl_Context)& theGlContext,
const Standard_Boolean theMSAA)
{
return Standard_False;
}
-// =======================================================================
-// function : updateSkydomeBg
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::updateSkydomeBg(const Handle(OpenGl_Context)& theCtx)
{
if (!myToUpdateSkydome)
theCtx->arbFBO->glBindFramebuffer(GL_FRAMEBUFFER, aPrevFBO);
}
-// =======================================================================
-// function : checkPBRAvailability
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_View::checkPBRAvailability() const
{
return myWorkspace->GetGlContext()->HasPBR() && !myPBREnvironment.IsNull();
}
-// =======================================================================
-// function : updatePBREnvironment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_View::updatePBREnvironment(const Handle(OpenGl_Context)& theCtx)
{
if (myBackgroundType == Graphic3d_TOB_CUBEMAP && myToUpdateSkydome)
return Standard_True;
}
-// =======================================================================
-// function : LoadFromStrings
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_View::ShaderSource::LoadFromStrings(
const TCollection_AsciiString* theStrings,
const TCollection_AsciiString& thePrefix)
return true;
}
-// =======================================================================
-// function : runPathtraceOut
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_View::runPathtraceOut(const Graphic3d_Camera::Projection theProjection,
OpenGl_FrameBuffer* theReadDrawFbo,
const Handle(OpenGl_Context)& theGlContext)
} // namespace
-// =======================================================================
-// function : OpenGl_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Window::OpenGl_Window()
: myOwnGContext(false),
mySwapInterval(0)
//
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Window::Init(const Handle(OpenGl_GraphicDriver)& theDriver,
const Handle(Aspect_Window)& thePlatformWindow,
const Handle(Aspect_Window)& theSizeWindow,
init();
}
-// =======================================================================
-// function : ~OpenGl_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Window::~OpenGl_Window()
{
if (!myOwnGContext || myGlContext.IsNull())
#endif // !__APPLE__
-// =======================================================================
-// function : Activate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Window::Activate()
{
return myGlContext->MakeCurrent();
init();
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Window::init()
{
if (!Activate())
}
}
-// =======================================================================
-// function : SetSwapInterval
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Window::SetSwapInterval(Standard_Boolean theToForceNoSync)
{
const Standard_Integer aSwapInterval = theToForceNoSync ? 0 : myGlContext->caps->swapInterval;
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_Workspace, Standard_Transient)
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Material::Init(const OpenGl_Context& theCtx,
const Graphic3d_MaterialAspect& theFront,
const Quantity_Color& theFrontColor,
}
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Material::init(const OpenGl_Context& theCtx,
const Graphic3d_MaterialAspect& theMat,
const Quantity_Color& theInteriorColor,
aCommon.Emission = theCtx.Vec4FromQuantityColor(aCommon.Emission);
}
-// =======================================================================
-// function : OpenGl_Workspace
-// purpose :
-// =======================================================================
+//=================================================================================================
+
OpenGl_Workspace::OpenGl_Workspace(OpenGl_View* theView, const Handle(OpenGl_Window)& theWindow)
: myView(theView),
myWindow(theWindow),
myFrontCulling.Aspect()->SetAlphaMode(Graphic3d_AlphaMode_Opaque);
}
-// =======================================================================
-// function : Activate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Workspace::Activate()
{
if (myWindow.IsNull() || !myWindow->Activate())
}
}
-// =======================================================================
-// function : SetDefaultPolygonOffset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_PolygonOffset OpenGl_Workspace::SetDefaultPolygonOffset(
const Graphic3d_PolygonOffset& theOffset)
{
return aPrev;
}
-// =======================================================================
-// function : SetAspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const OpenGl_Aspects* OpenGl_Workspace::SetAspects(const OpenGl_Aspects* theAspect)
{
const OpenGl_Aspects* aPrevAspects = myAspectsSet;
return aPrevAspects;
}
-// =======================================================================
-// function : ApplyAspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const OpenGl_Aspects* OpenGl_Workspace::ApplyAspects(bool theToBindTextures)
{
// bool toSuppressBackFaces = myView->BackfacingModel() ==
return myAspectsSet;
}
-// =======================================================================
-// function : Width
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OpenGl_Workspace::Width() const
{
return !myView->GlWindow().IsNull() ? myView->GlWindow()->Width() : 0;
}
-// =======================================================================
-// function : Height
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer OpenGl_Workspace::Height() const
{
return !myView->GlWindow().IsNull() ? myView->GlWindow()->Height() : 0;
}
-// =======================================================================
-// function : FBOCreate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(OpenGl_FrameBuffer) OpenGl_Workspace::FBOCreate(const Standard_Integer theWidth,
const Standard_Integer theHeight)
{
return aFrameBuffer;
}
-// =======================================================================
-// function : FBORelease
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Workspace::FBORelease(Handle(OpenGl_FrameBuffer)& theFbo)
{
// activate OpenGL context
theFbo.Nullify();
}
-// =======================================================================
-// function : BufferDump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean OpenGl_Workspace::BufferDump(const Handle(OpenGl_FrameBuffer)& theFbo,
Image_PixMap& theImage,
const Graphic3d_BufferType& theBufferType)
&& OpenGl_FrameBuffer::BufferDump(GetGlContext(), theFbo, theImage, theBufferType);
}
-// =======================================================================
-// function : ShouldRender
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool OpenGl_Workspace::ShouldRender(const OpenGl_Element* theElement, const OpenGl_Group* theGroup)
{
if ((myRenderFilter & OpenGl_RenderFilter_SkipTrsfPersistence) != 0)
return true;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void OpenGl_Workspace::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
#include <Draw_PluginMacro.hxx>
#include <OpenGl_GraphicDriverFactory.hxx>
-// ======================================================================
-// function : Factory
-// purpose :
-// ======================================================================
+//=================================================================================================
+
void OpenGlTest::Factory(Draw_Interpretor& theDI)
{
static const Handle(OpenGl_GraphicDriverFactory) aFactory = new OpenGl_GraphicDriverFactory();
#include <Poly_ArrayOfNodes.hxx>
-// =======================================================================
-// function : Poly_ArrayOfNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_ArrayOfNodes::Poly_ArrayOfNodes(const Poly_ArrayOfNodes& theOther)
: NCollection_AliasedArray(theOther)
{
//
}
-// =======================================================================
-// function : ~Poly_ArrayOfNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_ArrayOfNodes::~Poly_ArrayOfNodes()
{
//
}
-// =======================================================================
-// function : Assign
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_ArrayOfNodes& Poly_ArrayOfNodes::Assign(const Poly_ArrayOfNodes& theOther)
{
if (&theOther == this)
#include <Poly_ArrayOfUVNodes.hxx>
-// =======================================================================
-// function : Poly_ArrayOfUVNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_ArrayOfUVNodes::Poly_ArrayOfUVNodes(const Poly_ArrayOfUVNodes& theOther)
: NCollection_AliasedArray(theOther)
{
//
}
-// =======================================================================
-// function : ~Poly_ArrayOfUVNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_ArrayOfUVNodes::~Poly_ArrayOfUVNodes()
{
//
}
-// =======================================================================
-// function : Assign
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_ArrayOfUVNodes& Poly_ArrayOfUVNodes::Assign(const Poly_ArrayOfUVNodes& theOther)
{
if (&theOther == this)
Poly_MergeNodesTool::Vec3AndNormal myKey;
};
-// =======================================================================
-// function : MergedNodesMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_MergeNodesTool::MergedNodesMap::MergedNodesMap(const int theNbBuckets)
: NCollection_BaseMap(theNbBuckets, true, new NCollection_IncAllocator()),
myTolerance(0.0f),
//
}
-// =======================================================================
-// function : MergedNodesMap::SetMergeTolerance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_MergeNodesTool::MergedNodesMap::SetMergeTolerance(double theTolerance)
{
myTolerance = (float)theTolerance;
}
}
-// =======================================================================
-// function : MergedNodesMap::hashCode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline size_t Poly_MergeNodesTool::MergedNodesMap::vec3iHashCode(
const Poly_MergeNodesTool::MergedNodesMap::CellVec3i& theVec,
const int theUpper)
return aHashCode % theUpper + 1;
}
-// =======================================================================
-// function : MergedNodesMap::hashCode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline size_t Poly_MergeNodesTool::MergedNodesMap::hashCode(const NCollection_Vec3<float>& thePos,
const NCollection_Vec3<float>& theNorm,
const int theUpper) const
return vec3iHashCode(anIndex, theUpper);
}
-// =======================================================================
-// function : MergedNodesMap::vec3AreEqual
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline bool Poly_MergeNodesTool::MergedNodesMap::vec3AreEqual(
const NCollection_Vec3<float>& theKey1,
const NCollection_Vec3<float>& theKey2) const
return true;
}
-// =======================================================================
-// function : MergedNodesMap::isEqual
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline bool Poly_MergeNodesTool::MergedNodesMap::isEqual(const Vec3AndNormal& theKey1,
const NCollection_Vec3<float>& thePos2,
const NCollection_Vec3<float>& theNorm2,
return false;
}
-// =======================================================================
-// function : MergedNodesMap::Bind
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline bool Poly_MergeNodesTool::MergedNodesMap::Bind(int& theIndex,
bool& theIsOpposite,
const NCollection_Vec3<float>& thePos,
return true;
}
-// =======================================================================
-// function : MergedNodesMap::ReSize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
inline void Poly_MergeNodesTool::MergedNodesMap::ReSize(const int theSize)
{
NCollection_ListNode** aNewData = NULL;
}
}
-// =======================================================================
-// function : Poly_MergeNodesTool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Poly_MergeNodesTool::Poly_MergeNodesTool(const double theSmoothAngle,
const double theMergeTolerance,
const int theNbFacets)
SetMergeTolerance(theMergeTolerance);
}
-// =======================================================================
-// function : AddElement
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_MergeNodesTool::AddElement(const gp_XYZ* theElemNodes, int theNbNodes)
{
if (theNbNodes != 3 && theNbNodes != 4)
PushLastElement(theNbNodes);
}
-// =======================================================================
-// function : PushLastElement
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_MergeNodesTool::PushLastElement(int theNbNodes)
{
if (theNbNodes != 3 && theNbNodes != 4)
}
}
-// =======================================================================
-// function : AddTriangulation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_MergeNodesTool::AddTriangulation(const Handle(Poly_Triangulation)& theTris,
const gp_Trsf& theTrsf,
const Standard_Boolean theToReverse)
}
}
-// =======================================================================
-// function : Result
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Poly_Triangulation) Poly_MergeNodesTool::Result()
{
if (myPolyData.IsNull())
return myPolyData;
}
-// =======================================================================
-// function : MergeNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Poly_Triangulation) Poly_MergeNodesTool::MergeNodes(
const Handle(Poly_Triangulation)& theTris,
const gp_Trsf& theTrsf,
}
}
-// =======================================================================
-// function : SetDoublePrecision
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_Triangulation::SetDoublePrecision(bool theIsDouble)
{
myNodes.SetDoublePrecision(theIsDouble);
myUVNodes.SetDoublePrecision(theIsDouble);
}
-// =======================================================================
-// function : ResizeNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_Triangulation::ResizeNodes(Standard_Integer theNbNodes, Standard_Boolean theToCopyOld)
{
myNodes.Resize(theNbNodes, theToCopyOld);
}
}
-// =======================================================================
-// function : ResizeTriangles
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_Triangulation::ResizeTriangles(Standard_Integer theNbTriangles,
Standard_Boolean theToCopyOld)
{
myTriangles.Resize(1, theNbTriangles, theToCopyOld);
}
-// =======================================================================
-// function : AddUVNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_Triangulation::AddUVNodes()
{
if (myUVNodes.IsEmpty() || myUVNodes.Size() != myNodes.Size())
}
}
-// =======================================================================
-// function : AddNormals
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_Triangulation::AddNormals()
{
if (myNormals.IsEmpty() || myNormals.Size() != myNodes.Size())
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
void Poly_Triangulation::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, myPurpose)
}
-// =======================================================================
-// function : CachedMinMax
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Bnd_Box& Poly_Triangulation::CachedMinMax() const
{
static const Bnd_Box anEmptyBox;
return (myCachedMinMax == NULL) ? anEmptyBox : *myCachedMinMax;
}
-// =======================================================================
-// function : SetCachedMinMax
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_Triangulation::SetCachedMinMax(const Bnd_Box& theBox)
{
if (theBox.IsVoid())
*myCachedMinMax = theBox;
}
-// =======================================================================
-// function : unsetCachedMinMax
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Poly_Triangulation::unsetCachedMinMax()
{
if (myCachedMinMax != NULL)
}
}
-// =======================================================================
-// function : MinMax
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Poly_Triangulation::MinMax(Bnd_Box& theBox,
const gp_Trsf& theTrsf,
const bool theIsAccurate) const
return Standard_True;
}
-// =======================================================================
-// function : computeBoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Bnd_Box Poly_Triangulation::computeBoundingBox(const gp_Trsf& theTrsf) const
{
Bnd_Box aBox;
#include <Poly_Triangulation.hxx>
#include <Prs3d_LineAspect.hxx>
-// =========================================================================
-// function : AddFreeEdges
-// purpose :
-// =========================================================================
+//=================================================================================================
+
void Prs3d::AddFreeEdges(TColgp_SequenceOfPnt& theSegments,
const Handle(Poly_Triangulation)& thePolyTri,
const gp_Trsf& theLocation)
return aSegments;
}
-// ============================================================================
-// function : DrawShaded
-// purpose :
-// ============================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfTriangles) Prs3d_Arrow::DrawShaded(const gp_Ax1& theAxis,
const Standard_Real theTubeRadius,
const Standard_Real theAxisLength,
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_ArrowAspect, Prs3d_BasicAspect)
-// =======================================================================
-// function : Prs3d_ArrowAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_ArrowAspect::Prs3d_ArrowAspect()
: myArrowAspect(
new Graphic3d_AspectLine3d(Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0)),
//
}
-// =======================================================================
-// function : Prs3d_ArrowAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_ArrowAspect::Prs3d_ArrowAspect(const Standard_Real theAngle, const Standard_Real theLength)
: myArrowAspect(
new Graphic3d_AspectLine3d(Quantity_Color(Quantity_NOC_WHITE), Aspect_TOL_SOLID, 1.0)),
//
}
-// =======================================================================
-// function : Prs3d_ArrowAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_ArrowAspect::Prs3d_ArrowAspect(const Handle(Graphic3d_AspectLine3d)& theAspect)
: myArrowAspect(theAspect),
myAngle(M_PI / 180.0 * 10.0),
//
}
-// =======================================================================
-// function : SetAngle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_ArrowAspect::SetAngle(const Standard_Real theAngle)
{
Prs3d_InvalidAngle_Raise_if(theAngle <= 0.0 || theAngle >= M_PI / 2.0,
myAngle = theAngle;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_ArrowAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_DatumAspect, Prs3d_BasicAspect)
-// =======================================================================
-// function : Prs3d_DatumAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_DatumAspect::Prs3d_DatumAspect()
: myAxes(Prs3d_DatumAxes_XYZAxes),
myToDrawLabels(Standard_True),
myTextAspects[Prs3d_DatumParts_ZAxis] = new Prs3d_TextAspect();
}
-// =======================================================================
-// function : DrawDatumPart
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Prs3d_DatumAspect::DrawDatumPart(Prs3d_DatumParts thePart) const
{
switch (thePart)
return false;
}
-// =======================================================================
-// function : AxisLength
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Prs3d_DatumAspect::AxisLength(Prs3d_DatumParts thePart) const
{
switch (thePart)
return 0.0;
}
-// =======================================================================
-// function : ArrowPartForAxis
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_DatumParts Prs3d_DatumAspect::ArrowPartForAxis(Prs3d_DatumParts thePart)
{
switch (thePart)
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_DatumAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
myArrowAspect->SetColor(theColor);
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_DimensionAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
static const Quantity_NameOfColor THE_DEF_COLOR_Section = Quantity_NOC_ORANGE;
} // namespace
-// =======================================================================
-// function : Prs3d_Drawer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_Drawer::Prs3d_Drawer()
: myNbPoints(-1),
myMaximalParameterValue(-1.0),
myDimensionDisplayUnits.SetAngleUnits("deg");
}
-// =======================================================================
-// function : SetupOwnDefaults
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_Drawer::SetupOwnDefaults()
{
myNbPoints = 30;
SetDimensionAspect(new Prs3d_DimensionAspect());
}
-// =======================================================================
-// function : SetTypeOfDeflection
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetTypeOfDeflection(const Aspect_TypeOfDeflection theTypeOfDeflection)
{
return Prs3d_TOH_PolyAlgo;
}
-// =======================================================================
-// function : SetIsoOnTriangulation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_Drawer::SetIsoOnTriangulation(const Standard_Boolean theToEnable)
{
myHasOwnIsoOnTriangulation = Standard_True;
myIsoOnTriangulation = theToEnable;
}
-// =======================================================================
-// function : SetIsoOnPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetIsoOnPlane(const Standard_Boolean theIsEnabled)
{
myDeviationAngle = theAngle;
}
-// =======================================================================
-// function : SetAutoTriangulation
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetAutoTriangulation(const Standard_Boolean theIsEnabled)
{
myIsAutoTriangulated = theIsEnabled;
}
-// =======================================================================
-// function : FreeBoundaryAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FreeBoundaryAspect() const
{
return myFreeBoundaryAspect;
}
-// =======================================================================
-// function : SetFreeBoundaryDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetFreeBoundaryDraw(const Standard_Boolean theIsEnabled)
{
myFreeBoundaryDraw = theIsEnabled;
}
-// =======================================================================
-// function : UnFreeBoundaryAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::UnFreeBoundaryAspect() const
{
return myUnFreeBoundaryAspect;
}
-// =======================================================================
-// function : SetUnFreeBoundaryDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetUnFreeBoundaryDraw(const Standard_Boolean theIsEnabled)
{
myUnFreeBoundaryDraw = theIsEnabled;
}
-// =======================================================================
-// function : FaceBoundaryAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::FaceBoundaryAspect() const
{
return myFaceBoundaryAspect;
}
-// =======================================================================
-// function : SetFaceBoundaryDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetFaceBoundaryDraw(const Standard_Boolean theIsEnabled)
{
myFaceBoundaryDraw = theIsEnabled;
}
-// =======================================================================
-// function : DimensionAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_DimensionAspect)& Prs3d_Drawer::DimensionAspect() const
{
return myDimensionAspect;
}
-// =======================================================================
-// function : SetDimLengthModelUnits
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetDimLengthModelUnits(const TCollection_AsciiString& theUnits)
{
myDimensionModelUnits.SetLengthUnits(theUnits);
}
-// =======================================================================
-// function : SetDimAngleModelUnits
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetDimAngleModelUnits(const TCollection_AsciiString& theUnits)
{
myDimensionModelUnits.SetAngleUnits(theUnits);
}
-// =======================================================================
-// function : SetDimLengthDisplayUnits
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetDimLengthDisplayUnits(const TCollection_AsciiString& theUnits)
{
myDimensionDisplayUnits.SetLengthUnits(theUnits);
}
-// =======================================================================
-// function : SetDimAngleDisplayUnits
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetDimAngleDisplayUnits(const TCollection_AsciiString& theUnits)
{
myDimensionDisplayUnits.SetAngleUnits(theUnits);
}
-// =======================================================================
-// function : UIsoAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::UIsoAspect() const
{
return myUIsoAspect;
}
-// =======================================================================
-// function : VIsoAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_IsoAspect)& Prs3d_Drawer::VIsoAspect() const
{
return myVIsoAspect;
}
-// =======================================================================
-// function : WireAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::WireAspect() const
{
return myWireAspect;
}
-// =======================================================================
-// function : SetWireDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetWireDraw(const Standard_Boolean theIsEnabled)
{
myWireDraw = theIsEnabled;
}
-// =======================================================================
-// function : PointAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_PointAspect)& Prs3d_Drawer::PointAspect() const
{
return myPointAspect;
}
-// =======================================================================
-// function : SetupOwnPointAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Prs3d_Drawer::SetupOwnPointAspect(const Handle(Prs3d_Drawer)& theDefaults)
{
if (!myPointAspect.IsNull())
return Standard_True;
}
-// =======================================================================
-// function : LineAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::LineAspect() const
{
return myLineAspect;
}
-// =======================================================================
-// function : TextAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_TextAspect)& Prs3d_Drawer::TextAspect() const
{
return myTextAspect;
}
-// =======================================================================
-// function : ShadingAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_ShadingAspect)& Prs3d_Drawer::ShadingAspect() const
{
return myShadingAspect;
}
-// =======================================================================
-// function : SetupOwnShadingAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Prs3d_Drawer::SetupOwnShadingAspect(const Handle(Prs3d_Drawer)& theDefaults)
{
if (!myShadingAspect.IsNull())
return Standard_True;
}
-// =======================================================================
-// function : PlaneAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_PlaneAspect)& Prs3d_Drawer::PlaneAspect() const
{
return myPlaneAspect;
}
-// =======================================================================
-// function : SeenLineAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SeenLineAspect() const
{
return mySeenLineAspect;
}
-// =======================================================================
-// function : ArrowAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_ArrowAspect)& Prs3d_Drawer::ArrowAspect() const
{
return myArrowAspect;
}
-// =======================================================================
-// function : SetLineArrowDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetLineArrowDraw(const Standard_Boolean theIsEnabled)
{
myLineArrowDraw = theIsEnabled;
}
-// =======================================================================
-// function : HiddenLineAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::HiddenLineAspect() const
{
return myHiddenLineAspect;
}
-// =======================================================================
-// function : EnableDrawHiddenLineDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::EnableDrawHiddenLine()
{
myDrawHiddenLine = Standard_True;
}
-// =======================================================================
-// function : DisableDrawHiddenLine
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::DisableDrawHiddenLine()
{
myDrawHiddenLine = Standard_False;
}
-// =======================================================================
-// function : VectorAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::VectorAspect() const
{
return myVectorAspect;
}
-// =======================================================================
-// function : SetVertexDrawMode
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::SetVertexDrawMode(const Prs3d_VertexDrawMode theMode)
{
myVertexDrawMode = theMode;
}
-// =======================================================================
-// function : VertexDrawMode
-// purpose :
-// =======================================================================
+//=================================================================================================
Prs3d_VertexDrawMode Prs3d_Drawer::VertexDrawMode() const
{
return Prs3d_VDM_Isolated;
}
-// =======================================================================
-// function : DatumAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_DatumAspect)& Prs3d_Drawer::DatumAspect() const
{
return myDatumAspect;
}
-// =======================================================================
-// function : SectionAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
const Handle(Prs3d_LineAspect)& Prs3d_Drawer::SectionAspect() const
{
return mySectionAspect;
}
-// =======================================================================
-// function : SetSectionAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
void Prs3d_Drawer::ClearLocalAttributes()
{
myTypeOfHLR = Prs3d_TOH_NotSet;
}
-// =======================================================================
-// function : SetupOwnFaceBoundaryAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Prs3d_Drawer::SetupOwnFaceBoundaryAspect(const Handle(Prs3d_Drawer)& theDefaults)
{
if (!myFaceBoundaryAspect.IsNull())
return true;
}
-// =======================================================================
-// function : SetOwnLineAspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Prs3d_Drawer::SetOwnLineAspects(const Handle(Prs3d_Drawer)& theDefaults)
{
bool isUpdateNeeded = false;
return isUpdateNeeded;
}
-// =======================================================================
-// function : SetOwnDatumAspects
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Prs3d_Drawer::SetOwnDatumAspects(const Handle(Prs3d_Drawer)& theDefaults)
{
bool isUpdateNeeded = false;
}
}
-// =======================================================================
-// function : SetShaderProgram
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Prs3d_Drawer::SetShaderProgram(const Handle(Graphic3d_ShaderProgram)& theProgram,
const Graphic3d_GroupAspect theAspect,
const bool theToOverrideDefaults)
return false;
}
-// =======================================================================
-// function : SetShadingModel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Prs3d_Drawer::SetShadingModel(Graphic3d_TypeOfShadingModel theModel,
bool theToOverrideDefaults)
{
return isUpdateNeeded;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_Drawer::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_LineAspect, Prs3d_BasicAspect)
-// =======================================================================
-// function : Prs3d_LineAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_LineAspect::Prs3d_LineAspect(const Quantity_Color& theColor,
const Aspect_TypeOfLine theType,
const Standard_Real theWidth)
//
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_LineAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PlaneAspect, Prs3d_BasicAspect)
-// =======================================================================
-// function : Prs3d_PlaneAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_PlaneAspect::Prs3d_PlaneAspect()
: myEdgesAspect(new Prs3d_LineAspect(Quantity_NOC_GREEN, Aspect_TOL_SOLID, 1.0)),
myIsoAspect(new Prs3d_LineAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, 0.5)),
//
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_PlaneAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_PointAspect, Prs3d_BasicAspect)
-// =======================================================================
-// function : Prs3d_PointAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_PointAspect::Prs3d_PointAspect(const Aspect_TypeOfMarker theType,
const Quantity_Color& theColor,
const Standard_Real theScale)
//
}
-// =======================================================================
-// function : Prs3d_PointAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_PointAspect::Prs3d_PointAspect(const Quantity_Color& theColor,
const Standard_Integer theWidth,
const Standard_Integer theHeight,
//
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_PointAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
//
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_PresentationShadow::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
return 0.0;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_ShadingAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
#include <Prs3d_TextAspect.hxx>
#include <TCollection_ExtendedString.hxx>
-// =======================================================================
-// function : Draw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_Text) Prs3d_Text::Draw(const Handle(Graphic3d_Group)& theGroup,
const Handle(Prs3d_TextAspect)& theAspect,
const TCollection_ExtendedString& theText,
return aText;
}
-// =======================================================================
-// function : Draw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_Text) Prs3d_Text::Draw(const Handle(Graphic3d_Group)& theGroup,
const Handle(Prs3d_TextAspect)& theAspect,
const TCollection_ExtendedString& theText,
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_TextAspect, Prs3d_BasicAspect)
-// =======================================================================
-// function : Prs3d_TextAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_TextAspect::Prs3d_TextAspect()
: myTextAspect(
new Graphic3d_AspectText3d(Quantity_Color(Quantity_NOC_YELLOW), Font_NOF_SERIF, 1.0, 0.0)),
//
}
-// =======================================================================
-// function : Prs3d_TextAspect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Prs3d_TextAspect::Prs3d_TextAspect(const Handle(Graphic3d_AspectText3d)& theAspect)
: myTextAspect(theAspect),
myHeight(16.0),
//
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Prs3d_TextAspect::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
}
}
-// =======================================================================
-// function : AddClipPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentableObject::AddClipPlane(const Handle(Graphic3d_ClipPlane)& thePlane)
{
// add to collection and process changes
UpdateClipping();
}
-// =======================================================================
-// function : RemoveClipPlane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentableObject::RemoveClipPlane(const Handle(Graphic3d_ClipPlane)& thePlane)
{
if (myClipPlanes.IsNull())
}
}
-// =======================================================================
-// function : SetClipPlanes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentableObject::SetClipPlanes(
const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes)
{
UpdateClipping();
}
-// =======================================================================
-// function : UpdateClipping
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentableObject::UpdateClipping()
{
for (PrsMgr_Presentations::Iterator aPrsIter(myPresentations); aPrsIter.More(); aPrsIter.Next())
}
}
-// =======================================================================
-// function : SetMutable
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentableObject::SetMutable(const Standard_Boolean theIsMutable)
{
if (myIsMutable == theIsMutable)
}
}
-// =======================================================================
-// function : UnsetAttributes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentableObject::UnsetAttributes()
{
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentableObject::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
Erase();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_Presentation::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_PresentationManager, Standard_Transient)
-// =======================================================================
-// function : PrsMgr_PresentationManager
-// purpose :
-// =======================================================================
+//=================================================================================================
+
PrsMgr_PresentationManager::PrsMgr_PresentationManager(
const Handle(Graphic3d_StructureManager)& theStructureManager)
: myStructureManager(theStructureManager),
//
}
-// =======================================================================
-// function : Display
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Display(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode)
{
}
}
-// =======================================================================
-// function : Erase
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Erase(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode)
{
}
}
-// =======================================================================
-// function : Clear
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Clear(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode)
{
}
}
-// =======================================================================
-// function : SetVisibility
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::SetVisibility(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode,
const Standard_Boolean theValue)
}
}
-// =======================================================================
-// function : Unhighlight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Unhighlight(const Handle(PrsMgr_PresentableObject)& thePrsObj)
{
if (thePrsObj->ToPropagateVisualState())
}
}
-// =======================================================================
-// function : SetDisplayPriority
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::SetDisplayPriority(
const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode,
}
}
-// =======================================================================
-// function : DisplayPriority
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_DisplayPriority PrsMgr_PresentationManager::DisplayPriority(
const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
return !aPrs.IsNull() ? aPrs->DisplayPriority() : Graphic3d_DisplayPriority_INVALID;
}
-// =======================================================================
-// function : IsDisplayed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean PrsMgr_PresentationManager::IsDisplayed(
const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
return !aPrs.IsNull() && aPrs->IsDisplayed();
}
-// =======================================================================
-// function : IsHighlighted
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean PrsMgr_PresentationManager::IsHighlighted(
const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
return !aPrs.IsNull() && aPrs->IsHighlighted();
}
-// =======================================================================
-// function : Update
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Update(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
{
}
}
-// =======================================================================
-// function : BeginImmediateDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::BeginImmediateDraw()
{
if (++myImmediateModeOn > 1)
ClearImmediateDraw();
}
-// =======================================================================
-// function : ClearImmediateDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::ClearImmediateDraw()
{
for (PrsMgr_ListOfPresentations::Iterator anIter(myImmediateList); anIter.More(); anIter.Next())
}
}
-// =======================================================================
-// function : EndImmediateDraw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::EndImmediateDraw(const Handle(V3d_Viewer)& theViewer)
{
if (--myImmediateModeOn > 0)
myImmediateList.Append(thePrs);
}
-// =======================================================================
-// function : HasPresentation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean PrsMgr_PresentationManager::HasPresentation(
const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode) const
return Standard_False;
}
-// =======================================================================
-// function : Presentation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(PrsMgr_Presentation) PrsMgr_PresentationManager::Presentation(
const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode,
return aPrs;
}
-// =======================================================================
-// function : RemovePresentation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean PrsMgr_PresentationManager::RemovePresentation(
const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Standard_Integer theMode)
return Standard_False;
}
-// =======================================================================
-// function : SetZLayer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::SetZLayer(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Graphic3d_ZLayerId theLayerId)
{
thePrsObj->SetZLayer(theLayerId);
}
-// =======================================================================
-// function : GetZLayer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_ZLayerId PrsMgr_PresentationManager::GetZLayer(
const Handle(PrsMgr_PresentableObject)& thePrsObj) const
{
return thePrsObj->ZLayer();
}
-// =======================================================================
-// function : Connect
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Connect(const Handle(PrsMgr_PresentableObject)& thePrsObject,
const Handle(PrsMgr_PresentableObject)& theOtherObject,
const Standard_Integer theMode,
aPrs->Connect(aPrsOther.get(), Graphic3d_TOC_DESCENDANT);
}
-// =======================================================================
-// function : Transform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Transform(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Handle(TopLoc_Datum3D)& theTransformation,
const Standard_Integer theMode)
Presentation(thePrsObj, theMode)->SetTransformation(theTransformation);
}
-// =======================================================================
-// function : Color
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::Color(const Handle(PrsMgr_PresentableObject)& thePrsObj,
const Handle(Prs3d_Drawer)& theStyle,
const Standard_Integer theMode,
}
} // namespace
-// =======================================================================
-// function : UpdateHighlightTrsf
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void PrsMgr_PresentationManager::UpdateHighlightTrsf(
const Handle(V3d_Viewer)& theViewer,
const Handle(PrsMgr_PresentableObject)& theObj,
#include "Quantity_ColorTable.pxx"
};
-// =======================================================================
-// function : Epsilon
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Quantity_Color::Epsilon()
{
return TheEpsilon;
}
-// =======================================================================
-// function : SetEpsilon
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Quantity_Color::SetEpsilon(const Standard_Real theEpsilon)
{
TheEpsilon = theEpsilon;
}
-// =======================================================================
-// function : valuesOf
-// purpose :
-// =======================================================================
+//=================================================================================================
+
NCollection_Vec3<float> Quantity_Color::valuesOf(const Quantity_NameOfColor theName,
const Quantity_TypeOfColor theType)
{
throw Standard_ProgramError("Internal error");
}
-// =======================================================================
-// function : StringName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CString Quantity_Color::StringName(const Quantity_NameOfColor theName)
{
if ((Standard_Integer)theName < 0 || (Standard_Integer)theName > Quantity_NOC_WHITE)
return THE_COLORS[theName].StringName;
}
-// =======================================================================
-// function : ColorFromName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Quantity_Color::ColorFromName(const Standard_CString theName,
Quantity_NameOfColor& theColor)
{
return true;
}
-// =======================================================================
-// function : Quantity_Color
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Quantity_Color::Quantity_Color(const Standard_Real theC1,
const Standard_Real theC2,
const Standard_Real theC3,
SetValues(theC1, theC2, theC3, theType);
}
-// =======================================================================
-// function : Quantity_Color
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Quantity_Color::Quantity_Color(const NCollection_Vec3<float>& theRgb)
: myRgb(theRgb)
{
Quantity_ColorValidateRgbRange(theRgb.r(), theRgb.g(), theRgb.b());
}
-// =======================================================================
-// function : ChangeContrast
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Quantity_Color::ChangeContrast(const Standard_Real theDelta)
{
NCollection_Vec3<float> aHls = Convert_LinearRGB_To_HLS(myRgb);
}
}
-// =======================================================================
-// function : ChangeIntensity
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Quantity_Color::ChangeIntensity(const Standard_Real theDelta)
{
NCollection_Vec3<float> aHls = Convert_LinearRGB_To_HLS(myRgb);
}
}
-// =======================================================================
-// function : SetValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Quantity_Color::SetValues(const Standard_Real theC1,
const Standard_Real theC2,
const Standard_Real theC3,
}
}
-// =======================================================================
-// function : Delta
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Quantity_Color::Delta(const Quantity_Color& theColor,
Standard_Real& theDC,
Standard_Real& theDI) const
return aDeltaE2000;
}
-// =======================================================================
-// function : Name
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Quantity_NameOfColor Quantity_Color::Name() const
{
// it is better finding closest sRGB color (closest to human eye) instead of linear RGB color,
return aResName;
}
-// =======================================================================
-// function : Values
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Quantity_Color::Values(Standard_Real& theR1,
Standard_Real& theR2,
Standard_Real& theR3,
}
}
-// =======================================================================
-// function : saveNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::saveNodes(RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_ShapeIterator& theShapeIter,
}
}
-// =======================================================================
-// function : saveNormals
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::saveNormals(RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_FaceIterator& theFaceIter,
}
}
-// =======================================================================
-// function : saveTextCoords
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::saveTextCoords(RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_FaceIterator& theFaceIter,
}
}
-// =======================================================================
-// function : saveTriangleIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::saveTriangleIndices(RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_FaceIterator& theFaceIter,
}
}
-// =======================================================================
-// function : saveEdgeIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::saveEdgeIndices(RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_EdgeIterator& theFaceIter)
}
}
-// =======================================================================
-// function : saveVertexIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::saveVertexIndices(RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_VertexIterator& theFaceIter)
}
}
-// =======================================================================
-// function : saveIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::saveIndices(RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
const RWMesh_ShapeIterator& theFaceIter,
}
}
-// =======================================================================
-// function : Perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_CafWriter::Perform(const Handle(TDocStd_Document)& theDocument,
const TColStd_IndexedDataMapOfStringString& theFileInfo,
const Message_ProgressRange& theProgress)
return Perform(theDocument, aRoots, NULL, theFileInfo, theProgress);
}
-// =======================================================================
-// function : Perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_CafWriter::Perform(const Handle(TDocStd_Document)& theDocument,
const TDF_LabelSequence& theRootLabels,
const TColStd_MapOfAsciiString* theLabelFilter,
return writeJson(theDocument, theRootLabels, theLabelFilter, theFileInfo, aPSentry.Next());
}
-// =======================================================================
-// function : dispatchShapes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::dispatchShapes(
const XCAFPrs_DocumentNode& theDocNode,
const Message_ProgressScope& thePSentryBin,
}
}
-// =======================================================================
-// function : saveShapes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean RWGltf_CafWriter::writeShapesToBin(
RWGltf_GltfFace& theGltfFace,
std::ostream& theBinFile,
return true;
}
-// =======================================================================
-// function : writeBinData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_CafWriter::writeBinData(const Handle(TDocStd_Document)& theDocument,
const TDF_LabelSequence& theRootLabels,
const TColStd_MapOfAsciiString* theLabelFilter,
#endif
}
-// =======================================================================
-// function : writeAccessors
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeAccessors(const RWGltf_GltfSceneNodeMap&)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writePositions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writePositions(const RWGltf_GltfFace& theGltfFace)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeNormals
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeNormals(const RWGltf_GltfFace& theGltfFace)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeTextCoords
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeTextCoords(const RWGltf_GltfFace& theGltfFace)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeIndices(const RWGltf_GltfFace& theGltfFace)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeAnimations
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeAnimations()
{
Standard_ProgramError_Raise_if(myWriter.get() == NULL,
// myWriter->EndArray();
}
-// =======================================================================
-// function : writeAsset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeAsset(const TColStd_IndexedDataMapOfStringString& theFileInfo)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeBufferViews
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeBufferViews(const Standard_Integer theBinDataBufferId)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeBuffers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeBuffers()
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeExtensions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeExtensions()
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeImages
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeImages(const RWGltf_GltfSceneNodeMap& theSceneNodeMap)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeMaterials
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeMaterials(const RWGltf_GltfSceneNodeMap& theSceneNodeMap)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writePrimArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writePrimArray(const RWGltf_GltfFace& theGltfFace,
const TCollection_AsciiString& theName,
const int theDracoBufInd,
#endif
}
-// =======================================================================
-// function : writeShapes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeShapes(RWMesh_ShapeIterator& theShapeIter,
Standard_Integer& theNbFacesInNode,
Standard_Integer& theDracoBufInd,
}
}
-// =======================================================================
-// function : writeMeshes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeMeshes(const RWGltf_GltfSceneNodeMap& theSceneNodeMap)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeNodes(const Handle(TDocStd_Document)& theDocument,
const TDF_LabelSequence& theRootLabels,
const TColStd_MapOfAsciiString* theLabelFilter,
#endif
}
-// =======================================================================
-// function : writeExtrasAttributes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeExtrasAttributes(const Handle(TDataStd_NamedData)& theNamedData)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeSamplers
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeSamplers()
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeScene
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeScene(const Standard_Integer theDefSceneId)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : writeScenes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeScenes(
const NCollection_Sequence<Standard_Integer>& theSceneRootNodeInds)
{
#endif
}
-// =======================================================================
-// function : writeSkins
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeSkins()
{
Standard_ProgramError_Raise_if(myWriter.get() == NULL,
myWriter->EndArray();*/
}
-// =======================================================================
-// function : writeTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_CafWriter::writeTextures(const RWGltf_GltfSceneNodeMap& theSceneNodeMap)
{
#ifdef HAVE_RAPIDJSON
Handle(TDataStd_NamedData) myResult; //!< Result of parsing.
};
-// =======================================================================
-// function : RWGltf_ExtrasParser
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_ExtrasParser::RWGltf_ExtrasParser(const TCollection_AsciiString& theParentID,
const RWGltf_JsonValue& theExtrasValue)
: myParentID(theParentID),
{
}
-// =======================================================================
-// function : parseValue
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(TDataStd_NamedData) RWGltf_ExtrasParser::Parse()
{
parseObject(myExtrasValue);
return myResult;
}
-// =======================================================================
-// function : parseValue
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(TDataStd_NamedData) RWGltf_ExtrasParser::ParseExtras(
const TCollection_AsciiString& theParentID,
const RWGltf_JsonValue* theExtrasValue)
return anExtrasParser.Parse();
}
-// =======================================================================
-// function : parseValue
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_ExtrasParser::parseObject(const RWGltf_JsonValue& theValue,
const std::string& theValueName)
{
return anIsAnyValProcessed;
}
-// =======================================================================
-// function : parseNumber
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_ExtrasParser::parseNumber(const RWGltf_JsonValue& theValue,
const std::string& theValueName)
{
return false;
}
-// =======================================================================
-// function : parseString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_ExtrasParser::parseString(const RWGltf_JsonValue& theValue,
const std::string& theValueName)
{
return false;
}
-// =======================================================================
-// function : parseArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_ExtrasParser::parseArray(const RWGltf_JsonValue& theValue,
const std::string& theValueName)
{
return true;
}
-// =======================================================================
-// function : parseArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(TDataStd_NamedData)& RWGltf_ExtrasParser::getResult()
{
if (myResult.IsNull())
return anIter != theObject.MemberEnd() ? &anIter->value : NULL;
}
-// =======================================================================
-// function : RWGltf_GltfJsonParser::FormatParseError
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const char* RWGltf_GltfJsonParser::FormatParseError(rapidjson::ParseErrorCode theCode)
{
switch (theCode)
return "UNKOWN syntax error";
}
-// =======================================================================
-// function : GltfElementMap::Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfJsonParser::GltfElementMap::Init(const TCollection_AsciiString& theRootName,
const RWGltf_JsonValue* theRoot)
{
}
}
-// =======================================================================
-// function : parseTransformationMatrix
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::parseTransformationMatrix(const TCollection_AsciiString& theSceneNodeId,
const RWGltf_JsonValue& theMatrixVal,
TopLoc_Location& theResult) const
return true;
}
-// =======================================================================
-// function : RWGltf_GltfJsonParser
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::parseTransformationComponents(
const TCollection_AsciiString& theSceneNodeId,
const RWGltf_JsonValue* theRotationVal,
}
#endif
-// =======================================================================
-// function : reportGltfSyntaxProblem
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfJsonParser::reportGltfSyntaxProblem(const TCollection_AsciiString& theMsg,
Message_Gravity theGravity) const
{
Message::Send(myErrorPrefix + theMsg, theGravity);
}
-// =======================================================================
-// function : RWGltf_GltfJsonParser
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_GltfJsonParser::RWGltf_GltfJsonParser(TopTools_SequenceOfShape& theRootShapes)
: myRootShapes(&theRootShapes),
myAttribMap(NULL),
myCSTrsf.SetInputCoordinateSystem(RWMesh_CoordinateSystem_glTF);
}
-// =======================================================================
-// function : SetFilePath
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfJsonParser::SetFilePath(const TCollection_AsciiString& theFilePath)
{
myFilePath = theFilePath;
}
#ifdef HAVE_RAPIDJSON
-// =======================================================================
-// function : gltfParseRoots
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseRoots()
{
// find glTF root elements for smooth navigation
return true;
}
-// =======================================================================
-// function : gltfParseAsset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfJsonParser::gltfParseAsset()
{
const RWGltf_JsonValue* anAsset = myGltfRoots[RWGltf_GltfRootElement_Asset].Root();
}
}
-// =======================================================================
-// function : gltfParseMaterials
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfJsonParser::gltfParseMaterials()
{
const RWGltf_JsonValue* aMatList = myGltfRoots[RWGltf_GltfRootElement_Materials].Root();
}
}
-// =======================================================================
-// function : gltfBindMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfJsonParser::gltfBindMaterial(
const Handle(RWGltf_MaterialMetallicRoughness)& theMatPbr,
const Handle(RWGltf_MaterialCommon)& theMatCommon)
myMaterials.Bind(!theMatPbr.IsNull() ? theMatPbr->Id : theMatCommon->Id, aMat);
}
-// =======================================================================
-// function : gltfParseStdMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseStdMaterial(Handle(RWGltf_MaterialCommon)& theMat,
const RWGltf_JsonValue& theMatNode)
{
return true;
}
-// =======================================================================
-// function : gltfParsePbrMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParsePbrMaterial(Handle(RWGltf_MaterialMetallicRoughness)& theMat,
const RWGltf_JsonValue& theMatNode)
{
return true;
}
-// =======================================================================
-// function : gltfParseCommonMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseCommonMaterial(Handle(RWGltf_MaterialCommon)& theMat,
const RWGltf_JsonValue& theMatNode)
{
return true;
}
-// =======================================================================
-// function : gltfParseTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseTexture(Handle(Image_Texture)& theTexture,
const RWGltf_JsonValue* theTextureId)
{
return true;
}
-// =======================================================================
-// function : gltfParseTexturInGlbBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseTexturInGlbBuffer(
Handle(Image_Texture)& theTexture,
const RWGltf_JsonValue& theBinVal,
return true;
}
-// =======================================================================
-// function : gltfParseTextureInBufferView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseTextureInBufferView(
Handle(Image_Texture)& theTexture,
const TCollection_AsciiString& theSourceId,
return true;
}
-// =======================================================================
-// function : gltfParseScene
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseScene(const Message_ProgressRange& theProgress)
{
const RWGltf_JsonValue* aScenes = myGltfRoots[RWGltf_GltfRootElement_Scenes].Root();
return gltfParseSceneNodes(*myRootShapes, *aSceneNodes, theProgress);
}
-// =======================================================================
-// function : gltfParseSceneNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseSceneNodes(TopTools_SequenceOfShape& theShapeSeq,
const RWGltf_JsonValue& theSceneNodes,
const Message_ProgressRange& theProgress)
return true;
}
-// =======================================================================
-// function : gltfParseSceneNode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseSceneNode(TopoDS_Shape& theNodeShape,
const TCollection_AsciiString& theSceneNodeId,
const RWGltf_JsonValue& theSceneNode,
return true;
}
-// =======================================================================
-// function : gltfParseMesh
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseMesh(TopoDS_Shape& theMeshShape,
const TCollection_AsciiString& theMeshId,
const RWGltf_JsonValue& theMesh)
return true;
}
-// =======================================================================
-// function : gltfParsePrimArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParsePrimArray(TopoDS_Shape& thePrimArrayShape,
const TCollection_AsciiString& theMeshId,
const TCollection_AsciiString& theMeshName,
return true;
}
-// =======================================================================
-// function : gltfParseAccessor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseAccessor(
const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
const TCollection_AsciiString& theName,
theType);
}
-// =======================================================================
-// function : gltfParseBufferView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseBufferView(
const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
const TCollection_AsciiString& theName,
theType);
}
-// =======================================================================
-// function : gltfParseBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::gltfParseBuffer(
const Handle(RWGltf_GltfLatePrimitiveArray)& theMeshData,
const TCollection_AsciiString& theName,
}
}
-// =======================================================================
-// function : bindNamedShape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfJsonParser::bindNamedShape(TopoDS_Shape& theShape,
ShapeMapGroup theGroup,
const TopLoc_Location& theLoc,
}
#endif
-// =======================================================================
-// function : Parse
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_GltfJsonParser::Parse(const Message_ProgressRange& theProgress)
{
Message_ProgressScope aPS(theProgress, "Parsing glTF", 1);
IMPLEMENT_STANDARD_RTTIEXT(RWGltf_GltfLatePrimitiveArray, RWMesh_TriangulationSource)
-// =======================================================================
-// function : RWGltf_GltfLatePrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_GltfLatePrimitiveArray::RWGltf_GltfLatePrimitiveArray(const TCollection_AsciiString& theId,
const TCollection_AsciiString& theName)
: myId(theId),
{
}
-// =======================================================================
-// function : ~RWGltf_GltfLatePrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_GltfLatePrimitiveArray::~RWGltf_GltfLatePrimitiveArray()
{
//
}
-// =======================================================================
-// function : BaseColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Quantity_ColorRGBA RWGltf_GltfLatePrimitiveArray::BaseColor() const
{
if (!myMaterialPbr.IsNull())
return Quantity_ColorRGBA();
}
-// =======================================================================
-// function : AddPrimArrayData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_GltfPrimArrayData& RWGltf_GltfLatePrimitiveArray::AddPrimArrayData(
RWGltf_GltfArrayType theType)
{
IMPLEMENT_STANDARD_RTTIEXT(RWGltf_GltfMaterialMap, RWMesh_MaterialMap)
-// =======================================================================
-// function : baseColorTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Image_Texture)& RWGltf_GltfMaterialMap::baseColorTexture(
const Handle(XCAFDoc_VisMaterial)& theMat)
{
return THE_NULL_TEXTURE;
}
-// =======================================================================
-// function : RWGltf_GltfMaterialMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_GltfMaterialMap::RWGltf_GltfMaterialMap(const TCollection_AsciiString& theFile,
const Standard_Integer theDefSamplerId)
: RWMesh_MaterialMap(theFile),
myMatNameAsKey = false;
}
-// =======================================================================
-// function : ~RWGltf_GltfMaterialMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_GltfMaterialMap::~RWGltf_GltfMaterialMap()
{
//
}
-// =======================================================================
-// function : AddImages
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::AddImages(RWGltf_GltfOStreamWriter* theWriter,
const XCAFPrs_Style& theStyle,
Standard_Boolean& theIsStarted)
addImage(theWriter, theStyle.Material()->PbrMaterial().OcclusionTexture, theIsStarted);
}
-// =======================================================================
-// function : AddGlbImages
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::AddGlbImages(std::ostream& theBinFile, const XCAFPrs_Style& theStyle)
{
if (theStyle.Material().IsNull() || theStyle.Material()->IsEmpty())
addGlbImage(theBinFile, theStyle.Material()->PbrMaterial().OcclusionTexture);
}
-// =======================================================================
-// function : addImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::addImage(RWGltf_GltfOStreamWriter* theWriter,
const Handle(Image_Texture)& theTexture,
Standard_Boolean& theIsStarted)
#endif
}
-// =======================================================================
-// function : addGlbImage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::addGlbImage(std::ostream& theBinFile,
const Handle(Image_Texture)& theTexture)
{
myImageMap.Add(theTexture, aBuffImage);
}
-// =======================================================================
-// function : FlushBufferViews
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::FlushGlbBufferViews(RWGltf_GltfOStreamWriter* theWriter,
const Standard_Integer theBinDataBufferId,
Standard_Integer& theBuffViewId)
#endif
}
-// =======================================================================
-// function : FlushGlbImages
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::FlushGlbImages(RWGltf_GltfOStreamWriter* theWriter)
{
#ifdef HAVE_RAPIDJSON
#endif
}
-// =======================================================================
-// function : AddMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::AddMaterial(RWGltf_GltfOStreamWriter* theWriter,
const XCAFPrs_Style& theStyle,
Standard_Boolean& theIsStarted)
#endif
}
-// =======================================================================
-// function : AddTextures
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::AddTextures(RWGltf_GltfOStreamWriter* theWriter,
const XCAFPrs_Style& theStyle,
Standard_Boolean& theIsStarted)
addTexture(theWriter, theStyle.Material()->PbrMaterial().OcclusionTexture, theIsStarted);
}
-// =======================================================================
-// function : addTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::addTexture(RWGltf_GltfOStreamWriter* theWriter,
const Handle(Image_Texture)& theTexture,
Standard_Boolean& theIsStarted)
#endif
}
-// =======================================================================
-// function : AddMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString RWGltf_GltfMaterialMap::AddMaterial(const XCAFPrs_Style& theStyle)
{
return RWMesh_MaterialMap::AddMaterial(theStyle);
}
-// =======================================================================
-// function : DefineMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_GltfMaterialMap::DefineMaterial(const XCAFPrs_Style& theStyle,
const TCollection_AsciiString& /*theKey*/,
const TCollection_AsciiString& theName)
IMPLEMENT_STANDARD_RTTIEXT(RWGltf_TriangulationReader, RWMesh_TriangulationReader)
-// =======================================================================
-// function : RWGltf_TriangulationReader
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWGltf_TriangulationReader::RWGltf_TriangulationReader()
{
//
}
-// =======================================================================
-// function : reportError
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWGltf_TriangulationReader::reportError(const TCollection_AsciiString& theText) const
{
Message::SendFail(TCollection_AsciiString("File '") + myFileName + "' defines invalid glTF!\n"
+ theText);
}
-// =======================================================================
-// function : LoadStreamData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::LoadStreamData(
const Handle(RWMesh_TriangulationSource)& theSourceMesh,
const Handle(Poly_Triangulation)& theDestMesh) const
return true;
}
-// =======================================================================
-// function : readStreamData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::readStreamData(
const Handle(RWGltf_GltfLatePrimitiveArray)& theSourceGltfMesh,
const RWGltf_GltfPrimArrayData& theGltfData,
return true;
}
-// =======================================================================
-// function : readFileData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::readFileData(
const Handle(RWGltf_GltfLatePrimitiveArray)& theSourceGltfMesh,
const RWGltf_GltfPrimArrayData& theGltfData,
return true;
}
-// =======================================================================
-// function : loadStreamData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::loadStreamData(
const Handle(RWMesh_TriangulationSource)& theSourceMesh,
const Handle(Poly_Triangulation)& theDestMesh,
return wasLoaded;
}
-// =======================================================================
-// function : readDracoBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::readDracoBuffer(
const Handle(RWGltf_GltfLatePrimitiveArray)& theSourceGltfMesh,
const RWGltf_GltfPrimArrayData& theGltfData,
#endif
}
-// =======================================================================
-// function : load
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::load(const Handle(RWMesh_TriangulationSource)& theSourceMesh,
const Handle(Poly_Triangulation)& theDestMesh,
const Handle(OSD_FileSystem)& theFileSystem) const
return true;
}
-// =======================================================================
-// function : finalizeLoading
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::finalizeLoading(
const Handle(RWMesh_TriangulationSource)& theSourceMesh,
const Handle(Poly_Triangulation)& theDestMesh) const
return RWMesh_TriangulationReader::finalizeLoading(theSourceMesh, theDestMesh);
}
-// =======================================================================
-// function : readBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWGltf_TriangulationReader::readBuffer(
const Handle(RWGltf_GltfLatePrimitiveArray)& theSourceMesh,
const Handle(Poly_Triangulation)& theDestMesh,
#include <TDataStd_Name.hxx>
#include <TDF_Tool.hxx>
-// ================================================================
-// Function : ReadNameAttribute
-// Purpose :
-// ================================================================
+//=================================================================================================
+
TCollection_AsciiString RWMesh::ReadNameAttribute(const TDF_Label& theLabel)
{
Handle(TDataStd_Name) aNodeName;
: TCollection_AsciiString();
}
-// ================================================================
-// Function : FormatName
-// Purpose :
-// ================================================================
+//=================================================================================================
+
TCollection_AsciiString RWMesh::FormatName(RWMesh_NameFormat theFormat,
const TDF_Label& theLabel,
const TDF_Label& theRefLabel)
IMPLEMENT_STANDARD_RTTIEXT(RWMesh_CafReader, Standard_Transient)
-// =======================================================================
-// function : RWMesh_CafReader
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_CafReader::RWMesh_CafReader()
: myToFillDoc(Standard_True),
myToFillIncomplete(Standard_True),
//
}
-// =======================================================================
-// function : ~RWMesh_CafReader
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_CafReader::~RWMesh_CafReader()
{
//
}
}
-// =======================================================================
-// function : SingleShape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TopoDS_Shape RWMesh_CafReader::SingleShape() const
{
if (myRootShapes.Size() > 1)
return TopoDS_Shape();
}
-// =======================================================================
-// function : perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean RWMesh_CafReader::perform(const TCollection_AsciiString& theFile,
const Message_ProgressRange& theProgress,
const Standard_Boolean theToProbe)
return perform(aStream, theFile, theProgress, theToProbe);
}
-// =======================================================================
-// function : perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean RWMesh_CafReader::perform(std::istream& theStream,
const TCollection_AsciiString& theFile,
const Message_ProgressRange& theProgress,
return Standard_True;
}
-// =======================================================================
-// function : fillDocument
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_CafReader::fillDocument()
{
if (!myToFillDoc || myXdeDoc.IsNull() || myRootShapes.IsEmpty())
XCAFDoc_ShapeTool::SetAutoNaming(wasAutoNaming);
}
-// =======================================================================
-// function : setShapeName
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_CafReader::setShapeName(const TDF_Label& theLabel,
const TopAbs_ShapeEnum theShapeType,
const TCollection_AsciiString& theName,
}
}
-// =======================================================================
-// function : setShapeStyle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_CafReader::setShapeStyle(const CafDocumentTools& theTools,
const TDF_Label& theLabel,
const XCAFPrs_Style& theStyle)
}
}
-// =======================================================================
-// function : setShapeNamedData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_CafReader::setShapeNamedData(const CafDocumentTools&,
const TDF_Label& theLabel,
const Handle(TDataStd_NamedData)& theNameData)
}
}
-// =======================================================================
-// function : addShapeIntoDoc
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean RWMesh_CafReader::addShapeIntoDoc(CafDocumentTools& theTools,
const TopoDS_Shape& theShape,
const TDF_Label& theLabel,
return Standard_True;
}
-// =======================================================================
-// function : addSubShapeIntoDoc
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean RWMesh_CafReader::addSubShapeIntoDoc(CafDocumentTools& theTools,
const TopoDS_Shape& theShape,
const TDF_Label& theParentLabel)
return Standard_True;
}
-// =======================================================================
-// function : generateNames
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_CafReader::generateNames(const TCollection_AsciiString& theFile,
const Standard_Integer theRootLower,
const Standard_Boolean theWithSubLabels)
#include <gp_Quaternion.hxx>
-// ================================================================
-// Function : RWMesh_CoordinateSystemConverter
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWMesh_CoordinateSystemConverter::RWMesh_CoordinateSystemConverter()
: myInputLengthUnit(-1.0),
myOutputLengthUnit(-1.0),
//
}
-// ================================================================
-// Function : Init
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void RWMesh_CoordinateSystemConverter::Init(const gp_Ax3& theInputSystem,
Standard_Real theInputLengthUnit,
const gp_Ax3& theOutputSystem,
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFPrs.hxx>
-// =======================================================================
-// function : RWMesh_EdgeIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_EdgeIterator::RWMesh_EdgeIterator(const TDF_Label& theLabel,
const TopLoc_Location& theLocation,
const Standard_Boolean theToMapColors,
Next();
}
-// =======================================================================
-// function : RWMesh_EdgeIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_EdgeIterator::RWMesh_EdgeIterator(const TopoDS_Shape& theShape,
const XCAFPrs_Style& theStyle)
: RWMesh_ShapeIterator(theShape, TopAbs_EDGE, theStyle)
Next();
}
-// =======================================================================
-// function : Next
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_EdgeIterator::Next()
{
for (; myIter.More(); myIter.Next())
resetEdge();
}
-// =======================================================================
-// function : initEdge
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_EdgeIterator::initEdge()
{
initShape();
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFPrs.hxx>
-// =======================================================================
-// function : RWMesh_FaceIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_FaceIterator::RWMesh_FaceIterator(const TDF_Label& theLabel,
const TopLoc_Location& theLocation,
const Standard_Boolean theToMapColors,
Next();
}
-// =======================================================================
-// function : RWMesh_FaceIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_FaceIterator::RWMesh_FaceIterator(const TopoDS_Shape& theShape,
const XCAFPrs_Style& theStyle)
: RWMesh_ShapeIterator(theShape, TopAbs_FACE, theStyle),
Next();
}
-// =======================================================================
-// function : normal
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Dir RWMesh_FaceIterator::normal(Standard_Integer theNode) const
{
gp_Dir aNormal(gp::DZ());
return aNormal;
}
-// =======================================================================
-// function : Next
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_FaceIterator::Next()
{
for (; myIter.More(); myIter.Next())
resetFace();
}
-// =======================================================================
-// function : initFace
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_FaceIterator::initFace()
{
myHasNormals = false;
IMPLEMENT_STANDARD_RTTIEXT(RWMesh_MaterialMap, Standard_Transient)
-// =======================================================================
-// function : RWMesh_MaterialMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_MaterialMap::RWMesh_MaterialMap(const TCollection_AsciiString& theFile)
: myFileName(theFile),
myKeyPrefix("mat_"),
}
}
-// =======================================================================
-// function : ~RWMesh_MaterialMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_MaterialMap::~RWMesh_MaterialMap()
{
//
}
-// =======================================================================
-// function : AddMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString RWMesh_MaterialMap::AddMaterial(const XCAFPrs_Style& theStyle)
{
if (myStyles.IsBound1(theStyle))
return aMatKey;
}
-// =======================================================================
-// function : copyFileTo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWMesh_MaterialMap::copyFileTo(const TCollection_AsciiString& theFileSrc,
const TCollection_AsciiString& theFileDst)
{
}
}
-// =======================================================================
-// function : CopyTexture
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWMesh_MaterialMap::CopyTexture(TCollection_AsciiString& theResTexture,
const Handle(Image_Texture)& theTexture,
const TCollection_AsciiString& theKey)
return theTexture->WriteImage(aResTexFile);
}
-// =======================================================================
-// function : CreateTextureFolder
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWMesh_MaterialMap::CreateTextureFolder()
{
if (!myTexFolder.IsEmpty())
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFPrs.hxx>
-// =======================================================================
-// function : RWMesh_ShapeIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_ShapeIterator::RWMesh_ShapeIterator(const TDF_Label& theLabel,
const TopLoc_Location& theLocation,
const TopAbs_ShapeEnum theShapeType,
}
}
-// =======================================================================
-// function : RWMesh_ShapeIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_ShapeIterator::RWMesh_ShapeIterator(const TopoDS_Shape& theShape,
const TopAbs_ShapeEnum theShapeType,
const XCAFPrs_Style& theStyle)
myIter.Init(theShape, myShapeType);
}
-// =======================================================================
-// function : dispatchStyles
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_ShapeIterator::dispatchStyles(const TDF_Label& theLabel,
const TopLoc_Location& theLocation,
const XCAFPrs_Style& theStyle)
}
}
-// =======================================================================
-// function : initEdge
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_ShapeIterator::initShape()
{
myHasColor = false;
}
} // namespace
-// =======================================================================
-// function : PrintStatistic
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_TriangulationReader::LoadingStatistic::PrintStatistic(
const TCollection_AsciiString& thePrefix) const
{
}
}
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_TriangulationReader::RWMesh_TriangulationReader()
: myLoadingStatistic(NULL),
myIsDoublePrecision(false),
{
}
-// =======================================================================
-// function : Destructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_TriangulationReader::~RWMesh_TriangulationReader()
{
delete myLoadingStatistic;
}
-// =======================================================================
-// function : Load
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWMesh_TriangulationReader::Load(const Handle(RWMesh_TriangulationSource)& theSourceMesh,
const Handle(Poly_Triangulation)& theDestMesh,
const Handle(OSD_FileSystem)& theFileSystem) const
return true;
}
-// =======================================================================
-// function : finalizeLoading
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWMesh_TriangulationReader::finalizeLoading(
const Handle(RWMesh_TriangulationSource)& theSourceMesh,
const Handle(Poly_Triangulation)& theDestMesh) const
return true;
}
-// =======================================================================
-// function : setNbEdges
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWMesh_TriangulationReader::setNbEdges(const Handle(Poly_Triangulation)& theMesh,
const Standard_Integer theNbTris,
const Standard_Boolean theToCopyData) const
return false;
}
-// =======================================================================
-// function : setEdge
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer RWMesh_TriangulationReader::setEdge(const Handle(Poly_Triangulation)& theMesh,
const Standard_Integer theIndex,
const Standard_Integer theEdge) const
IMPLEMENT_STANDARD_RTTIEXT(RWMesh_TriangulationSource, Poly_Triangulation)
-// =======================================================================
-// function : RWMesh_TriangulationSource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_TriangulationSource::RWMesh_TriangulationSource()
: myNbDefNodes(0),
myNbDefTriangles(0),
{
}
-// =======================================================================
-// function : ~RWMesh_TriangulationSource
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_TriangulationSource::~RWMesh_TriangulationSource()
{
//
}
-// =======================================================================
-// function : loadDeferredData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean RWMesh_TriangulationSource::loadDeferredData(
const Handle(OSD_FileSystem)& theFileSystem,
const Handle(Poly_Triangulation)& theDestTriangulation) const
return false;
}
-// =======================================================================
-// function : ResizeEdges
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_TriangulationSource::ResizeEdges(Standard_Integer theNbEdges,
Standard_Boolean theToCopyOld)
{
#include <XCAFDoc_ShapeTool.hxx>
#include <XCAFPrs.hxx>
-// =======================================================================
-// function : RWMesh_VertexIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_VertexIterator::RWMesh_VertexIterator(const TDF_Label& theLabel,
const TopLoc_Location& theLocation,
const Standard_Boolean theToMapColors,
Next();
}
-// =======================================================================
-// function : RWMesh_VertexIterator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWMesh_VertexIterator::RWMesh_VertexIterator(const TopoDS_Shape& theShape,
const XCAFPrs_Style& theStyle)
: RWMesh_ShapeIterator(theShape, TopAbs_VERTEX, theStyle)
Next();
}
-// =======================================================================
-// function : Next
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_VertexIterator::Next()
{
for (; myIter.More(); myIter.Next())
resetVertex();
}
-// =======================================================================
-// function : initEdge
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWMesh_VertexIterator::initVertex()
{
initShape();
return theFaceIter.IsEmptyMesh();
}
-// =======================================================================
-// function : Perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_CafWriter::Perform(const Handle(TDocStd_Document)& theDocument,
const TColStd_IndexedDataMapOfStringString& theFileInfo,
const Message_ProgressRange& theProgress)
return Perform(theDocument, aRoots, NULL, theFileInfo, theProgress);
}
-// =======================================================================
-// function : Perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_CafWriter::Perform(const Handle(TDocStd_Document)& theDocument,
const TDF_LabelSequence& theRootLabels,
const TColStd_MapOfAsciiString* theLabelFilter,
return isDone && !aPSentry.IsAborted();
}
-// =======================================================================
-// function : addFaceInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_CafWriter::addFaceInfo(const RWMesh_FaceIterator& theFace,
Standard_Integer& theNbNodes,
Standard_Integer& theNbElems,
|| (!theFace.FaceStyle().BaseColorTexture().IsNull() && theFace.HasTexCoords());
}
-// =======================================================================
-// function : writeShape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_CafWriter::writeShape(RWObj_ObjWriterContext& theWriter,
RWObj_ObjMaterialMap& theMatMgr,
Message_LazyProgressScope& thePSentry,
return true;
}
-// =======================================================================
-// function : writePositions
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_CafWriter::writePositions(RWObj_ObjWriterContext& theWriter,
Message_LazyProgressScope& thePSentry,
const RWMesh_FaceIterator& theFace)
return true;
}
-// =======================================================================
-// function : writeNormals
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_CafWriter::writeNormals(RWObj_ObjWriterContext& theWriter,
Message_LazyProgressScope& thePSentry,
const RWMesh_FaceIterator& theFace)
return true;
}
-// =======================================================================
-// function : writeTextCoords
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_CafWriter::writeTextCoords(RWObj_ObjWriterContext& theWriter,
Message_LazyProgressScope& thePSentry,
const RWMesh_FaceIterator& theFace)
return true;
}
-// =======================================================================
-// function : writeIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_CafWriter::writeIndices(RWObj_ObjWriterContext& theWriter,
Message_LazyProgressScope& thePSentry,
const RWMesh_FaceIterator& theFace)
}
} // namespace
-// =======================================================================
-// function : RWObj_MtlReader
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWObj_MtlReader::RWObj_MtlReader(
NCollection_DataMap<TCollection_AsciiString, RWObj_Material>& theMaterials)
: myFile(NULL),
//
}
-// =======================================================================
-// function : ~RWObj_MtlReader
-// purpose :
-// =======================================================================
+//=================================================================================================
+
RWObj_MtlReader::~RWObj_MtlReader()
{
if (myFile != NULL)
}
}
-// =======================================================================
-// function : Read
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_MtlReader::Read(const TCollection_AsciiString& theFolder,
const TCollection_AsciiString& theFile)
{
return myMaterials->Extent() != aNbMatOld;
}
-// =======================================================================
-// function : processTexturePath
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_MtlReader::processTexturePath(TCollection_AsciiString& theTexturePath,
const TCollection_AsciiString& theFolder)
{
}
}
-// =======================================================================
-// function : validateScalar
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_MtlReader::validateScalar(const Standard_Real theValue)
{
if (theValue < 0.0 || theValue > 1.0)
return true;
}
-// =======================================================================
-// function : validateColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_MtlReader::validateColor(const Graphic3d_Vec3& theVec)
{
if (theVec.r() < 0.0f || theVec.r() > 1.0f || theVec.g() < 0.0f || theVec.g() > 1.0f
IMPLEMENT_STANDARD_RTTIEXT(RWObj_ObjMaterialMap, RWMesh_MaterialMap)
-// ================================================================
-// Function : RWObj_ObjMaterialMap
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWObj_ObjMaterialMap::RWObj_ObjMaterialMap(const TCollection_AsciiString& theFile)
: RWMesh_MaterialMap(theFile),
myFile(NULL)
//
}
-// ================================================================
-// Function : ~RWObj_ObjMaterialMap
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWObj_ObjMaterialMap::~RWObj_ObjMaterialMap()
{
if (myFile != NULL)
}
}
-// ================================================================
-// Function : AddMaterial
-// Purpose :
-// ================================================================
+//=================================================================================================
+
TCollection_AsciiString RWObj_ObjMaterialMap::AddMaterial(const XCAFPrs_Style& theStyle)
{
if (myFile == NULL && !myIsFailed)
return RWMesh_MaterialMap::AddMaterial(theStyle);
}
-// ================================================================
-// Function : DefineMaterial
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void RWObj_ObjMaterialMap::DefineMaterial(const XCAFPrs_Style& theStyle,
const TCollection_AsciiString& theKey,
const TCollection_AsciiString& theName)
#include <NCollection_IndexedMap.hxx>
#include <OSD_OpenFile.hxx>
-// =======================================================================
-// function : splitLines
-// purpose :
-// =======================================================================
+//=================================================================================================
+
static void splitLines(const TCollection_AsciiString& theString,
NCollection_IndexedMap<TCollection_AsciiString>& theLines)
{
}
}
-// ================================================================
-// Function : RWObj_ObjWriterContext
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWObj_ObjWriterContext::RWObj_ObjWriterContext(const TCollection_AsciiString& theName)
: NbFaces(0),
myFile(OSD_OpenFile(theName.ToCString(), "wb")),
}
}
-// ================================================================
-// Function : ~RWObj_ObjWriterContext
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWObj_ObjWriterContext::~RWObj_ObjWriterContext()
{
if (myFile != NULL)
}
}
-// ================================================================
-// Function : Close
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::Close()
{
bool isOk = ::fclose(myFile) == 0;
return isOk;
}
-// ================================================================
-// Function : WriteHeader
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteHeader(const Standard_Integer theNbNodes,
const Standard_Integer theNbElems,
const TCollection_AsciiString& theMatLib,
return isOk;
}
-// ================================================================
-// Function : WriteActiveMaterial
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteActiveMaterial(const TCollection_AsciiString& theMaterial)
{
myActiveMaterial = theMaterial;
: Fprintf(myFile, "usemtl\n") != 0;
}
-// ================================================================
-// Function : WriteTriangle
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteTriangle(const Graphic3d_Vec3i& theTri)
{
const Graphic3d_Vec3i aTriPos = theTri + myElemPosFirst.xyz();
}
}
-// ================================================================
-// Function : WriteQuad
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteQuad(const Graphic3d_Vec4i& theQuad)
{
const Graphic3d_Vec4i aQPos = theQuad + myElemPosFirst;
}
}
-// ================================================================
-// Function : WriteVertex
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteVertex(const Graphic3d_Vec3& theValue)
{
return Fprintf(myFile, "v %f %f %f\n", theValue.x(), theValue.y(), theValue.z()) != 0;
}
-// ================================================================
-// Function : WriteNormal
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteNormal(const Graphic3d_Vec3& theValue)
{
return Fprintf(myFile, "vn %f %f %f\n", theValue.x(), theValue.y(), theValue.z()) != 0;
}
-// ================================================================
-// Function : WriteTexCoord
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteTexCoord(const Graphic3d_Vec2& theValue)
{
return Fprintf(myFile, "vt %f %f\n", theValue.x(), theValue.y()) != 0;
}
-// ================================================================
-// Function : WriteGroup
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWObj_ObjWriterContext::WriteGroup(const TCollection_AsciiString& theValue)
{
return !theValue.IsEmpty() ? Fprintf(myFile, "g %s\n", theValue.ToCString()) != 0
: Fprintf(myFile, "g\n") != 0;
}
-// ================================================================
-// Function : FlushFace
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void RWObj_ObjWriterContext::FlushFace(Standard_Integer theNbNodes)
{
Graphic3d_Vec4i aShift(theNbNodes, theNbNodes, theNbNodes, theNbNodes);
}
} // namespace
-// ================================================================
-// Function : Read
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWObj_Reader::RWObj_Reader()
: myMemLimitBytes(Standard_Size(-1)),
myMemEstim(0),
//
}
-// ================================================================
-// Function : read
-// Purpose :
-// ================================================================
+//=================================================================================================
+
Standard_Boolean RWObj_Reader::read(std::istream& theStream,
const TCollection_AsciiString& theFile,
const Message_ProgressRange& theProgress,
return true;
}
-// =======================================================================
-// function : pushIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_Reader::pushIndices(const char* thePos)
{
char* aNext = NULL;
return triangulatePolygonFan(theIndices);
}
-// =======================================================================
-// function : pushObject
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_Reader::pushObject(const char* theObjectName)
{
TCollection_AsciiString aNewObject;
myActiveSubMesh.Object = aNewObject;
}
-// =======================================================================
-// function : pushGroup
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_Reader::pushGroup(const char* theGroupName)
{
TCollection_AsciiString aNewGroup;
myActiveSubMesh.Group = aNewGroup;
}
-// =======================================================================
-// function : pushSmoothGroup
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_Reader::pushSmoothGroup(const char* theSmoothGroupIndex)
{
TCollection_AsciiString aNewSmoothGroup;
myActiveSubMesh.SmoothGroup = aNewSmoothGroup;
}
-// =======================================================================
-// function : pushMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_Reader::pushMaterial(const char* theMaterialName)
{
TCollection_AsciiString aNewMat;
myActiveSubMesh.Material = aNewMat;
}
-// =======================================================================
-// function : readMaterialLib
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWObj_Reader::readMaterialLib(const char* theFileName)
{
TCollection_AsciiString aMatPath;
}
}
-// =======================================================================
-// function : checkMemory
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWObj_Reader::checkMemory()
{
if (myMemEstim < myMemLimitBytes || myToAbort)
return Standard_True;
}
-// =======================================================================
-// function : addSubShape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean RWObj_TriangulationReader::addSubShape(TopoDS_Shape& theParent,
const TopoDS_Shape& theSubShape,
const Standard_Boolean theToExpandCompound)
return theFaceIter.IsEmptyMesh();
}
-// =======================================================================
-// function : Perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWPly_CafWriter::Perform(const Handle(TDocStd_Document)& theDocument,
const TColStd_IndexedDataMapOfStringString& theFileInfo,
const Message_ProgressRange& theProgress)
return Perform(theDocument, aRoots, NULL, theFileInfo, theProgress);
}
-// =======================================================================
-// function : Perform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWPly_CafWriter::Perform(const Handle(TDocStd_Document)& theDocument,
const TDF_LabelSequence& theRootLabels,
const TColStd_MapOfAsciiString* theLabelFilter,
return isDone && !aPSentry.IsAborted();
}
-// =======================================================================
-// function : addFaceInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void RWPly_CafWriter::addFaceInfo(const RWMesh_FaceIterator& theFace,
Standard_Integer& theNbNodes,
Standard_Integer& theNbElems)
theNbElems += theFace.NbTriangles();
}
-// =======================================================================
-// function : writeShape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWPly_CafWriter::writeShape(RWPly_PlyWriterContext& theWriter,
Message_LazyProgressScope& thePSentry,
const Standard_Integer theWriteStep,
return true;
}
-// =======================================================================
-// function : writeNodes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWPly_CafWriter::writeNodes(RWPly_PlyWriterContext& theWriter,
Message_LazyProgressScope& thePSentry,
const RWMesh_FaceIterator& theFace)
return true;
}
-// =======================================================================
-// function : writeIndices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool RWPly_CafWriter::writeIndices(RWPly_PlyWriterContext& theWriter,
Message_LazyProgressScope& thePSentry,
const RWMesh_FaceIterator& theFace)
#include <NCollection_IndexedMap.hxx>
#include <OSD_FileSystem.hxx>
-// =======================================================================
-// function : splitLines
-// purpose :
-// =======================================================================
+//=================================================================================================
+
static void splitLines(const TCollection_AsciiString& theString,
NCollection_IndexedMap<TCollection_AsciiString>& theLines)
{
}
}
-// ================================================================
-// Function : RWPly_PlyWriterContext
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWPly_PlyWriterContext::RWPly_PlyWriterContext()
: myNbHeaderVerts(0),
myNbHeaderElems(0),
//
}
-// ================================================================
-// Function : ~RWPly_PlyWriterContext
-// Purpose :
-// ================================================================
+//=================================================================================================
+
RWPly_PlyWriterContext::~RWPly_PlyWriterContext()
{
Close();
}
-// ================================================================
-// Function : Open
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWPly_PlyWriterContext::Open(const TCollection_AsciiString& theName,
const std::shared_ptr<std::ostream>& theStream)
{
return true;
}
-// ================================================================
-// Function : Close
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWPly_PlyWriterContext::Close(bool theIsAborted)
{
if (myStream.get() == nullptr)
return aResult;
}
-// ================================================================
-// Function : WriteHeader
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWPly_PlyWriterContext::WriteHeader(const Standard_Integer theNbNodes,
const Standard_Integer theNbElems,
const TColStd_IndexedDataMapOfStringString& theFileInfo)
return myStream->good();
}
-// ================================================================
-// Function : WriteVertex
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWPly_PlyWriterContext::WriteVertex(const gp_Pnt& thePoint,
const Graphic3d_Vec3& theNorm,
const Graphic3d_Vec2& theUV,
return myStream->good();
}
-// ================================================================
-// Function : WriteTriangle
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWPly_PlyWriterContext::WriteTriangle(const Graphic3d_Vec3i& theTri)
{
if (myStream.get() == nullptr)
return myStream->good();
}
-// ================================================================
-// Function : WriteQuad
-// Purpose :
-// ================================================================
+//=================================================================================================
+
bool RWPly_PlyWriterContext::WriteQuad(const Graphic3d_Vec4i& theQuad)
{
if (myStream.get() == nullptr)
}
} // namespace
-// ================================================================
-// Function : ReadStep
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void RWStepShape_RWEdgeCurve::ReadStep(const Handle(StepData_StepReaderData)& theStepData,
const Standard_Integer theRecordID,
Handle(Interface_Check)& theMessageTool,
theEdgeCurve->Init(aName, anEdgeStart, anEdgeEnd, anEdgeGeometry, aSameSense);
}
-// ================================================================
-// Function : WriteStep
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void RWStepShape_RWEdgeCurve::WriteStep(StepData_StepWriter& theStepWriter,
const Handle(StepShape_EdgeCurve)& theEdgeCurve) const
{
theStepWriter.SendBoolean(theEdgeCurve->SameSense());
}
-// ================================================================
-// Function : Share
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void RWStepShape_RWEdgeCurve::Share(const Handle(StepShape_EdgeCurve)& theEdgeCurve,
Interface_EntityIterator& theSharedEntitiesIt) const
{
theSharedEntitiesIt.GetOneItem(theEdgeCurve->EdgeGeometry());
}
-// ================================================================
-// Function : Check
-// Purpose :
-// ================================================================
+//=================================================================================================
+
void RWStepShape_RWEdgeCurve::Check(const Handle(StepShape_EdgeCurve)& theEdgeCurve,
const Interface_ShareTool& theShareTool,
Handle(Interface_Check)& theMessageTool) const
static Standard_Boolean Debug;
-// =======================================================================
-// function : Resource_Manager
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Resource_Manager::Resource_Manager(const TCollection_AsciiString& theName,
const TCollection_AsciiString& theDefaultsDirectory,
const TCollection_AsciiString& theUserDefaultsDirectory,
<< "UserDefaults\" not set." << std::endl;
}
-// =======================================================================
-// function : Resource_Manager
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Resource_Manager::Resource_Manager()
: myName(""),
myVerbose(Standard_False)
{
}
-// =======================================================================
-// function : Load
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Resource_Manager::Load(const TCollection_AsciiString& thePath,
Resource_DataMapOfAsciiStringAsciiString& aMap)
{
myPolygonsIdxs->ChangeValue(theIdx2) = aPolygIdx1;
}
-// =======================================================================
-// function : overlapsElement
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_InteriorSensitivePointSet::overlapsElement(
SelectBasics_PickResult& thePickResult,
SelectBasics_SelectingVolumeManager& theMgr,
return theMgr.OverlapsPolygon(aPoints->Array1(), Select3D_TOS_INTERIOR, thePickResult);
}
-// =======================================================================
-// function : elementIsInside
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_InteriorSensitivePointSet::elementIsInside(
SelectBasics_SelectingVolumeManager& theMgr,
Standard_Integer theElemIdx,
return myPlanarPolygons.Length();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_InteriorSensitivePointSet::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
return Standard_False;
}
-// =======================================================================
-// function : elementIsInside
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_SensitiveGroup::elementIsInside(
SelectBasics_SelectingVolumeManager& theMgr,
Standard_Integer theElemIdx,
return theMgr.DistToGeometryCenter(CenterOfGeometry());
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitiveGroup::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
return myCOG;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitivePoly::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
NCollection_Array1<Handle(Select3D_SensitivePrimitiveArray)>& myGroups;
};
-// =======================================================================
-// function : Select3D_SensitivePrimitiveArray
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Select3D_SensitivePrimitiveArray::Select3D_SensitivePrimitiveArray(
const Handle(SelectMgr_EntityOwner)& theOwnerId)
: Select3D_SensitiveSet(theOwnerId),
//
}
-// =======================================================================
-// function : SetDetectElementMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitivePrimitiveArray::SetDetectElementMap(bool theToDetect)
{
if (!theToDetect)
}
}
-// =======================================================================
-// function : SetDetectNodeMap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitivePrimitiveArray::SetDetectNodeMap(bool theToDetect)
{
if (!theToDetect)
}
}
-// =======================================================================
-// function : InitTriangulation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Select3D_SensitivePrimitiveArray::InitTriangulation(
const Handle(Graphic3d_Buffer)& theVerts,
const Handle(Graphic3d_IndexBuffer)& theIndices,
return true;
}
-// =======================================================================
-// function : InitPoints
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Select3D_SensitivePrimitiveArray::InitPoints(const Handle(Graphic3d_Buffer)& theVerts,
const Handle(Graphic3d_IndexBuffer)& theIndices,
const TopLoc_Location& theInitLoc,
return true;
}
-// =======================================================================
-// function : GetConnected
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Select3D_SensitiveEntity) Select3D_SensitivePrimitiveArray::GetConnected()
{
Handle(Select3D_SensitivePrimitiveArray) aNewEntity =
}
}
-// =======================================================================
-// function : BVH
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitivePrimitiveArray::BVH()
{
if (!myContent.IsDirty())
}
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Select3D_SensitivePrimitiveArray::Size() const
{
return myBvhIndices.NbElements;
}
-// =======================================================================
-// function : Box
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Select3D_BndBox3d Select3D_SensitivePrimitiveArray::Box(const Standard_Integer theIdx) const
{
const Standard_Integer anElemIdx = myBvhIndices.Index(theIdx);
return aBox;
}
-// =======================================================================
-// function : Center
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Select3D_SensitivePrimitiveArray::Center(const Standard_Integer theIdx,
const Standard_Integer theAxis) const
{
return theAxis == 0 ? aCenter.x() : (theAxis == 1 ? aCenter.y() : aCenter.z());
}
-// =======================================================================
-// function : Swap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitivePrimitiveArray::Swap(const Standard_Integer theIdx1,
const Standard_Integer theIdx2)
{
}
}
-// =======================================================================
-// function : BoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Select3D_BndBox3d Select3D_SensitivePrimitiveArray::BoundingBox()
{
if (!myBndBox.IsValid())
return applyTransformation();
}
-// =======================================================================
-// function : computeBoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitivePrimitiveArray::computeBoundingBox()
{
myBndBox.Clear();
}
}
-// =======================================================================
-// function : applyTransformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Select3D_BndBox3d Select3D_SensitivePrimitiveArray::applyTransformation()
{
if (!HasInitLocation())
return aBndBox;
}
-// =======================================================================
-// function : Matches
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_SensitivePrimitiveArray::Matches(
SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
return Standard_True;
}
-// =======================================================================
-// function : overlapsElement
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_SensitivePrimitiveArray::overlapsElement(
SelectBasics_PickResult& thePickResult,
SelectBasics_SelectingVolumeManager& theMgr,
return aResult;
}
-// =======================================================================
-// function : distanceToCOG
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Select3D_SensitivePrimitiveArray::distanceToCOG(
SelectBasics_SelectingVolumeManager& theMgr)
{
return theMgr.DistToGeometryCenter(myCDG3D);
}
-// =======================================================================
-// function : elementIsInside
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_SensitivePrimitiveArray::elementIsInside(
SelectBasics_SelectingVolumeManager& theMgr,
Standard_Integer theElemIdx,
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitivePrimitiveArray::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveSphere, Select3D_SensitiveEntity)
-// ==================================================
-// Function: Select3D_SensitiveSphere
-// Purpose :
-// ==================================================
+//=================================================================================================
+
Select3D_SensitiveSphere::Select3D_SensitiveSphere(const Handle(SelectMgr_EntityOwner)& theOwnerId,
const gp_Pnt& theCenter,
const Standard_Real theRadius)
{
}
-// ==================================================
-// Function: Mathes
-// Purpose :
-// ==================================================
+//=================================================================================================
+
Standard_Boolean Select3D_SensitiveSphere::Matches(SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
{
return Standard_True;
}
-// ==================================================
-// Function: GetConnected
-// Purpose :
-// ==================================================
+//=================================================================================================
+
Handle(Select3D_SensitiveEntity) Select3D_SensitiveSphere::GetConnected()
{
Handle(Select3D_SensitiveEntity) aNewEntity =
return aNewEntity;
}
-// ==================================================
-// Function: BoundingBox
-// Purpose :
-// ==================================================
+//=================================================================================================
+
Select3D_BndBox3d Select3D_SensitiveSphere::BoundingBox()
{
const SelectMgr_Vec3 aMinPnt =
return Select3D_BndBox3d(aMinPnt, aMaxPnt);
}
-// =======================================================================
-// function : Matches
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_SensitiveTriangulation::Matches(
SelectBasics_SelectingVolumeManager& theMgr,
SelectBasics_PickResult& thePickResult)
return applyTransformation();
}
-// =======================================================================
-// function : computeBoundingBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitiveTriangulation::computeBoundingBox()
{
myBndBox.Clear();
return myInvInitLocation;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitiveTriangulation::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
return aSeg->Matches(theMgr, thePickResult);
}
-// =======================================================================
-// function : elementIsInside
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Select3D_SensitiveWire::elementIsInside(
SelectBasics_SelectingVolumeManager& theMgr,
Standard_Integer theElemIdx,
return myCenter;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Select3D_SensitiveWire::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
#include <SelectBasics_SelectingVolumeManager.hxx>
-// =======================================================================
-// function : SelectBasics_SelectingVolumeManager
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectBasics_SelectingVolumeManager::SelectBasics_SelectingVolumeManager()
{
//
}
-// =======================================================================
-// function : ~SelectBasics_SelectingVolumeManager
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectBasics_SelectingVolumeManager::~SelectBasics_SelectingVolumeManager()
{
//
}
-// =======================================================================
-// function : Overlaps
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectBasics_SelectingVolumeManager::Overlaps(
const Handle(TColgp_HArray1OfPnt)& theArrayOfPts,
Standard_Integer theSensType,
#include <SelectBasics_PickResult.hxx>
#include <SelectMgr_ViewClipRange.hxx>
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectMgr_AxisIntersector::SelectMgr_AxisIntersector()
{
//
}
-// =======================================================================
-// function : ~SelectMgr_AxisIntersector
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectMgr_AxisIntersector::~SelectMgr_AxisIntersector()
{
//
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_AxisIntersector::Init(const gp_Ax1& theAxis)
{
mySelectionType = SelectMgr_SelectionType_Point;
myAxis = theAxis;
}
-// =======================================================================
-// function : Build
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_AxisIntersector::Build() {}
//=================================================================================================
void SelectMgr_AxisIntersector::SetCamera(const Handle(Graphic3d_Camera)&) {}
-// =======================================================================
-// function : ScaleAndTransform
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(SelectMgr_BaseIntersector) SelectMgr_AxisIntersector::ScaleAndTransform(
const Standard_Integer theScaleFactor,
const gp_GTrsf& theTrsf,
return aRes;
}
-// =======================================================================
-// function : hasIntersection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::hasIntersection(const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax,
Standard_Real& theTimeEnter,
return Standard_True;
}
-// =======================================================================
-// function : hasIntersection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::hasIntersection(const gp_Pnt& thePnt,
Standard_Real& theDepth) const
{
return Standard_True;
}
-// =======================================================================
-// function : raySegmentDistance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::raySegmentDistance(
const gp_Pnt& theSegPnt1,
const gp_Pnt& theSegPnt2,
return true;
}
-// =======================================================================
-// function : rayPlaneIntersection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool SelectMgr_AxisIntersector::rayPlaneIntersection(const gp_Vec& thePlane,
const gp_Pnt& thePntOnPlane,
SelectBasics_PickResult& thePickResult) const
return true;
}
-// =======================================================================
-// function : OverlapsBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox(const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax,
Standard_Boolean* theInside) const
return Standard_True;
}
-// =======================================================================
-// function : OverlapsBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::OverlapsBox(
const SelectMgr_Vec3& theBoxMin,
const SelectMgr_Vec3& theBoxMax,
return Standard_True;
}
-// =======================================================================
-// function : OverlapsPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::OverlapsPoint(
const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange,
return !theClipRange.IsClipped(thePickResult.Depth());
}
-// =======================================================================
-// function : OverlapsPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::OverlapsPoint(const gp_Pnt& thePnt) const
{
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
return hasIntersection(thePnt, aDepth);
}
-// =======================================================================
-// function : OverlapsSegment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::OverlapsSegment(
const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
return !theClipRange.IsClipped(thePickResult.Depth());
}
-// =======================================================================
-// function : OverlapsPolygon
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::OverlapsPolygon(
const TColgp_Array1OfPnt& theArrayOfPnts,
Select3D_TypeOfSensitivity theSensType,
return !theClipRange.IsClipped(thePickResult.Depth());
}
-// =======================================================================
-// function : OverlapsTriangle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_AxisIntersector::OverlapsTriangle(
const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
return myAxis.Direction();
}
-// =======================================================================
-// function : DistToGeometryCenter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real SelectMgr_AxisIntersector::DistToGeometryCenter(const gp_Pnt& theCOG) const
{
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
return theCOG.Distance(myAxis.Location());
}
-// =======================================================================
-// function : DetectedPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt SelectMgr_AxisIntersector::DetectedPoint(const Standard_Real theDepth) const
{
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point,
}
}
-// =======================================================================
-// function : runThread
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Address SelectMgr_BVHThreadPool::BVHThread::runThread(Standard_Address theTask)
{
BVHThread* aThread = static_cast<BVHThread*>(theTask);
}
}
-// =======================================================================
-// function : Select
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_EntityOwner::Select(const AIS_SelectionScheme theSelScheme,
const Standard_Boolean theIsDetected) const
{
return Standard_False;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_EntityOwner::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
#include <SelectMgr_FrustumBuilder.hxx>
#include <SelectMgr_ViewClipRange.hxx>
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectMgr_RectangularFrustum::SelectMgr_RectangularFrustum()
: myScale(1.0)
{
}
-// =======================================================================
-// function : segmentSegmentDistance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_RectangularFrustum::segmentSegmentDistance(
const gp_Pnt& theSegPnt1,
const gp_Pnt& theSegPnt2,
+ aFigureVec.XYZ() * (aSegPntShift / aFigureVecMod));
}
-// =======================================================================
-// function : segmentPlaneIntersection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool SelectMgr_RectangularFrustum::segmentPlaneIntersection(
const gp_Vec& thePlane,
const gp_Pnt& thePntOnPlane,
}
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_RectangularFrustum::Init(const gp_Pnt2d& thePoint)
{
mySelectionType = SelectMgr_SelectionType_Point;
mySelRectangle.SetMousePos(thePoint);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_RectangularFrustum::Init(const gp_Pnt2d& theMinPnt, const gp_Pnt2d& theMaxPnt)
{
mySelectionType = SelectMgr_SelectionType_Box;
mySelRectangle.SetMaxPnt(theMaxPnt);
}
-// =======================================================================
-// function : Build
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_RectangularFrustum::Build()
{
Standard_ASSERT_RAISE(mySelectionType == SelectMgr_SelectionType_Point
return aRes;
}
-// =======================================================================
-// function : IsScalable
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_RectangularFrustum::IsScalable() const
{
return mySelectionType == SelectMgr_SelectionType_Point;
return hasCircleOverlap(theRadius, theTrsf, theIsFilled, theInside);
}
-// =======================================================================
-// function : GetMousePosition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const gp_Pnt2d& SelectMgr_RectangularFrustum::GetMousePosition() const
{
if (mySelectionType == SelectMgr_SelectionType_Point)
return base_type::GetMousePosition();
}
-// =======================================================================
-// function : OverlapsSphere
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsSphere(
const gp_Pnt& theCenter,
const Standard_Real theRadius,
return !theClipRange.IsClipped(thePickResult.Depth());
}
-// =======================================================================
-// function : OverlapsSphere
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_RectangularFrustum::OverlapsSphere(const gp_Pnt& theCenter,
const Standard_Real theRadius,
Standard_Boolean* theInside) const
return myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * theDepth / myScale;
}
-// =======================================================================
-// function : GetPlanes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_RectangularFrustum::GetPlanes(
NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const
{
return THE_NULL_ENTITYOWNER;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_SelectableObject::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_Selection::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
};
} // namespace
-// =======================================================================
-// function : CreateFiller
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(SelectMgr_SelectionImageFiller) SelectMgr_SelectionImageFiller::CreateFiller(
Image_PixMap& thePixMap,
SelectMgr_ViewerSelector* theSelector,
mySensitive.Nullify();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_SensitiveEntity::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
}
} // namespace
-// =======================================================================
-// function : SelectMgr_TriangularFrustum
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectMgr_TriangularFrustum::SelectMgr_TriangularFrustum()
{
//
}
-// =======================================================================
-// function : ~SelectMgr_TriangularFrustum
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectMgr_TriangularFrustum::~SelectMgr_TriangularFrustum()
{
Clear();
myBuilder.Nullify();
}
-// =======================================================================
-// function : GetPlanes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_TriangularFrustum::GetPlanes(
NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const
{
static const size_t MEMORY_BLOCK_SIZE = 512 * 7;
}
-// =======================================================================
-// function : SelectMgr_TriangularFrustumSet
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectMgr_TriangularFrustumSet::SelectMgr_TriangularFrustumSet()
: myToAllowOverlap(Standard_False)
{
}
-// =======================================================================
-// function : ~SelectMgr_TriangularFrustumSet
-// purpose :
-// =======================================================================
+//=================================================================================================
+
SelectMgr_TriangularFrustumSet::~SelectMgr_TriangularFrustumSet()
{
//
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_TriangularFrustumSet::Init(const TColgp_Array1OfPnt2d& thePoints)
{
if (mySelPolyline.Points.IsNull())
return aRes;
}
-// =======================================================================
-// function : OverlapsBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsBox(
const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt,
return Standard_False;
}
-// =======================================================================
-// function : OverlapsBox
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsBox(const SelectMgr_Vec3& theMinPnt,
const SelectMgr_Vec3& theMaxPnt,
Standard_Boolean* theInside) const
return Standard_False;
}
-// =======================================================================
-// function : OverlapsPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsPoint(
const gp_Pnt& thePnt,
const SelectMgr_ViewClipRange& theClipRange,
return Standard_False;
}
-// =======================================================================
-// function : OverlapsPolygon
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsPolygon(
const TColgp_Array1OfPnt& theArrayOfPts,
Select3D_TypeOfSensitivity theSensType,
return Standard_False;
}
-// =======================================================================
-// function : OverlapsSegment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsSegment(
const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
return Standard_False;
}
-// =======================================================================
-// function : OverlapsTriangle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean SelectMgr_TriangularFrustumSet::OverlapsTriangle(
const gp_Pnt& thePnt1,
const gp_Pnt& thePnt2,
return Standard_False;
}
-// =======================================================================
-// function : GetPlanes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_TriangularFrustumSet::GetPlanes(
NCollection_Vector<SelectMgr_Vec4>& thePlaneEquations) const
{
return Standard_True;
}
-// =======================================================================
-// function : DetectedPoint
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Pnt SelectMgr_TriangularFrustumSet::DetectedPoint(const Standard_Real theDepth) const
{
(void)theDepth;
#include <Graphic3d_SequenceOfHClipPlane.hxx>
-// =======================================================================
-// function : AddClippingPlanes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_ViewClipRange::AddClippingPlanes(const Graphic3d_SequenceOfHClipPlane& thePlanes,
const gp_Ax1& thePickRay)
{
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void SelectMgr_ViewClipRange::DumpJson(Standard_OStream& theOStream,
Standard_Integer theDepth) const
{
#include <Standard_ArrayStreamBuffer.hxx>
-// =======================================================================
-// function : Standard_ArrayStreamBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ArrayStreamBuffer::Standard_ArrayStreamBuffer(const char* theBegin, const size_t theSize)
: myBegin(theBegin),
myEnd(theBegin + theSize),
//
}
-// =======================================================================
-// function : ~Standard_ArrayStreamBuffer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ArrayStreamBuffer::~Standard_ArrayStreamBuffer()
{
//
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_ArrayStreamBuffer::Init(const char* theBegin, const size_t theSize)
{
myBegin = theBegin;
myCurrent = theBegin;
}
-// =======================================================================
-// function : underflow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ArrayStreamBuffer::int_type Standard_ArrayStreamBuffer::underflow()
{
if (myCurrent == myEnd)
return traits_type::to_int_type(*myCurrent);
}
-// =======================================================================
-// function : uflow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ArrayStreamBuffer::int_type Standard_ArrayStreamBuffer::uflow()
{
if (myCurrent == myEnd)
return traits_type::to_int_type(*myCurrent++);
}
-// =======================================================================
-// function : pbackfail
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ArrayStreamBuffer::int_type Standard_ArrayStreamBuffer::pbackfail(int_type ch)
{
if (myCurrent == myBegin || (ch != traits_type::eof() && ch != myCurrent[-1]))
return traits_type::to_int_type(*--myCurrent);
}
-// =======================================================================
-// function : showmanyc
-// purpose :
-// =======================================================================
+//=================================================================================================
+
std::streamsize Standard_ArrayStreamBuffer::showmanyc()
{
if (myCurrent > myEnd)
return myEnd - myCurrent;
}
-// =======================================================================
-// function : seekoff
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ArrayStreamBuffer::pos_type Standard_ArrayStreamBuffer::seekoff(
off_type theOff,
std::ios_base::seekdir theWay,
return myCurrent - myBegin;
}
-// =======================================================================
-// function : seekpos
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_ArrayStreamBuffer::pos_type Standard_ArrayStreamBuffer::seekpos(
pos_type thePosition,
std::ios_base::openmode theWhich)
return seekoff(off_type(thePosition), std::ios_base::beg, theWhich);
}
-// =======================================================================
-// function : xsgetn
-// purpose :
-// =======================================================================
+//=================================================================================================
+
std::streamsize Standard_ArrayStreamBuffer::xsgetn(char* thePtr, std::streamsize theCount)
{
const char* aCurrent = myCurrent + theCount;
} // namespace
-// =======================================================================
-// function : GetCLocale
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CLocaleSentry::clocale_t Standard_CLocaleSentry::GetCLocale()
{
return theCLocale.myLocale;
}
-// =======================================================================
-// function : Standard_CLocaleSentry
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CLocaleSentry::Standard_CLocaleSentry()
#ifdef OCCT_CLOCALE_POSIX2008
: myPrevLocale(uselocale(
#endif
}
-// =======================================================================
-// function : ~Standard_CLocaleSentry
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CLocaleSentry::~Standard_CLocaleSentry()
{
#if defined(OCCT_CLOCALE_POSIX2008)
#endif
} // namespace
-// =======================================================================
-// function : Standard_Condition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Condition::Standard_Condition(bool theIsSet)
#ifdef _WIN32
: myEvent((void*)::CreateEvent(0, true, theIsSet, NULL))
#endif
}
-// =======================================================================
-// function : ~Standard_Condition
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Condition::~Standard_Condition()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Condition::Set()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : Reset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Condition::Reset()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : Wait
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Condition::Wait()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : Wait
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Standard_Condition::Wait(int theTimeMilliseconds)
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : Check
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Standard_Condition::Check()
{
#ifdef _WIN32
#endif
}
-// =======================================================================
-// function : CheckReset
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Standard_Condition::CheckReset()
{
#ifdef _WIN32
#include <stdarg.h>
-// =======================================================================
-// function : AddValuesSeparator
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Dump::AddValuesSeparator(Standard_OStream& theOStream)
{
Standard_SStream aStream;
return Standard_True;
}
-// =======================================================================
-// function : GetPointerInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Standard_Dump::GetPointerInfo(const Handle(Standard_Transient)& thePointer,
const bool isShortInfo)
{
return GetPointerInfo(thePointer.get(), isShortInfo);
}
-// =======================================================================
-// function : GetPointerInfo
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString Standard_Dump::GetPointerInfo(const void* thePointer,
const bool isShortInfo)
{
static Standard_Integer Standard_Failure_DefaultStackTraceLength = 0;
} // namespace
-// =======================================================================
-// function : StringRef::allocate_message
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Failure::StringRef* Standard_Failure::StringRef::allocate_message(
const Standard_CString theString)
{
return aStrPtr;
}
-// =======================================================================
-// function : StringRef::copy_message
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Failure::StringRef* Standard_Failure::StringRef::copy_message(
Standard_Failure::StringRef* theString)
{
return theString;
}
-// =======================================================================
-// function : StringRef::deallocate_message
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::StringRef::deallocate_message(Standard_Failure::StringRef* theString)
{
if (theString != NULL)
}
}
-// =======================================================================
-// function : Standard_Failure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Failure::Standard_Failure()
: myMessage(NULL),
myStackTrace(NULL)
}
}
-// =======================================================================
-// function : Standard_Failure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Failure::Standard_Failure(const Standard_CString theDesc)
: myMessage(NULL),
myStackTrace(NULL)
}
}
-// =======================================================================
-// function : Standard_Failure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Failure::Standard_Failure(const Standard_CString theDesc,
const Standard_CString theStackTrace)
: myMessage(NULL),
myStackTrace = StringRef::allocate_message(theStackTrace);
}
-// =======================================================================
-// function : Standard_Failure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Failure::Standard_Failure(const Standard_Failure& theFailure)
: Standard_Transient(theFailure),
myMessage(NULL),
myStackTrace = StringRef::copy_message(theFailure.myStackTrace);
}
-// =======================================================================
-// function : ~Standard_Failure
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Failure::~Standard_Failure()
{
StringRef::deallocate_message(myMessage);
StringRef::deallocate_message(myStackTrace);
}
-// =======================================================================
-// function : GetMessageString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CString Standard_Failure::GetMessageString() const
{
return myMessage != NULL ? myMessage->GetMessage() : "";
}
-// =======================================================================
-// function : SetMessageString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::SetMessageString(const Standard_CString theDesc)
{
if (theDesc == GetMessageString())
myMessage = StringRef::allocate_message(theDesc);
}
-// =======================================================================
-// function : GetStackString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_CString Standard_Failure::GetStackString() const
{
return myStackTrace != NULL ? myStackTrace->GetMessage() : "";
}
-// =======================================================================
-// function : SetStackString
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::SetStackString(const Standard_CString theStack)
{
if (theStack == GetStackString())
myStackTrace = StringRef::allocate_message(theStack);
}
-// =======================================================================
-// function : Raise
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Raise(const Standard_CString theDesc)
{
Handle(Standard_Failure) aFailure = new Standard_Failure();
aFailure->Reraise(theDesc);
}
-// =======================================================================
-// function : Raise
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Raise(const Standard_SStream& theReason)
{
Handle(Standard_Failure) aFailure = new Standard_Failure();
aFailure->Reraise(theReason);
}
-// =======================================================================
-// function : Reraise
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Reraise(const Standard_CString theDesc)
{
SetMessageString(theDesc);
Reraise();
}
-// =======================================================================
-// function : Reraise
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Reraise(const Standard_SStream& theReason)
{
SetMessageString(theReason.str().c_str());
Reraise();
}
-// =======================================================================
-// function : Reraise
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Reraise()
{
Throw();
}
-// =======================================================================
-// function : Jump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Jump()
{
#if defined(OCC_CONVERT_SIGNALS)
#endif
}
-// =======================================================================
-// function : Throw
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Throw() const
{
throw *this;
}
-// =======================================================================
-// function : Print
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::Print(Standard_OStream& theStream) const
{
if (myMessage != NULL)
}
}
-// =======================================================================
-// function : NewInstance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Standard_Failure) Standard_Failure::NewInstance(Standard_CString theString)
{
return new Standard_Failure(theString);
}
-// =======================================================================
-// function : NewInstance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Standard_Failure) Standard_Failure::NewInstance(Standard_CString theMessage,
Standard_CString theStackTrace)
{
return new Standard_Failure(theMessage, theStackTrace);
}
-// =======================================================================
-// function : GetNbStackTraces
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer Standard_Failure::DefaultStackTraceLength()
{
return Standard_Failure_DefaultStackTraceLength;
}
-// =======================================================================
-// function : SetNbStackTraces
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Standard_Failure::SetDefaultStackTraceLength(Standard_Integer theNbStackTraces)
{
Standard_Failure_DefaultStackTraceLength = theNbStackTraces;
#endif
} // namespace
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
StdPrs_BRepFont::StdPrs_BRepFont()
: myPrecision(Precision::Confusion()),
myScaleUnits(1.0),
init();
}
-// =======================================================================
-// function : init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_BRepFont::init()
{
mySurface = new Geom_Plane(gp_Pln(gp::XOY()));
myCurvOnSurf.Load(aSurfAdaptor);
}
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
StdPrs_BRepFont::StdPrs_BRepFont(const NCollection_String& theFontPath,
const Standard_Real theSize,
const Standard_Integer theFaceId)
myFTFont->Init(theFontPath.ToCString(), THE_FONT_PARAMS, theFaceId);
}
-// =======================================================================
-// function : Constructor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
StdPrs_BRepFont::StdPrs_BRepFont(const NCollection_String& theFontName,
const Font_FontAspect theFontAspect,
const Standard_Real theSize,
myFTFont->FindAndInit(theFontName.ToCString(), theFontAspect, THE_FONT_PARAMS, theStrictLevel);
}
-// =======================================================================
-// function : Release
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_BRepFont::Release()
{
myCache.Clear();
myFTFont->Release();
}
-// =======================================================================
-// function : FindAndCreate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(StdPrs_BRepFont) StdPrs_BRepFont::FindAndCreate(const TCollection_AsciiString& theFontName,
const Font_FontAspect theFontAspect,
const Standard_Real theSize,
return Handle(StdPrs_BRepFont)();
}
-// =======================================================================
-// function : SetCompositeCurveMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_BRepFont::SetCompositeCurveMode(const Standard_Boolean theToConcatenate)
{
if (myIsCompositeCurve != theToConcatenate)
}
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool StdPrs_BRepFont::Init(const NCollection_String& theFontPath,
const Standard_Real theSize,
const Standard_Integer theFaceId)
return myFTFont->Init(theFontPath.ToCString(), THE_FONT_PARAMS, theFaceId);
}
-// =======================================================================
-// function : FindAndInit
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool StdPrs_BRepFont::FindAndInit(const TCollection_AsciiString& theFontName,
const Font_FontAspect theFontAspect,
const Standard_Real theSize,
theStrictLevel);
}
-// =======================================================================
-// function : RenderGlyph
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TopoDS_Shape StdPrs_BRepFont::RenderGlyph(const Standard_Utf32Char& theChar)
{
TopoDS_Shape aShape;
return aShape;
}
-// =======================================================================
-// function : to3d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool StdPrs_BRepFont::to3d(const Handle(Geom2d_Curve)& theCurve2d,
const GeomAbs_Shape theContinuity,
Handle(Geom_Curve)& theCurve3d)
return !theCurve3d.IsNull();
}
-// =======================================================================
-// function : buildFaces
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean StdPrs_BRepFont::buildFaces(const NCollection_Sequence<TopoDS_Wire>& theWires,
TopoDS_Shape& theRes)
{
#endif
}
-// =======================================================================
-// function : renderGlyph
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean StdPrs_BRepFont::renderGlyph(const Standard_Utf32Char theChar,
TopoDS_Shape& theShape)
{
#include <Font_TextFormatter.hxx>
-// =======================================================================
-// Function : Perform
-// Purpose :
-// =======================================================================
+//=================================================================================================
+
TopoDS_Shape StdPrs_BRepTextBuilder::Perform(StdPrs_BRepFont& theFont,
const Handle(Font_TextFormatter)& theFormatter,
const gp_Ax3& thePenLoc)
return aResult;
}
-// =======================================================================
-// Function : Perform
-// Purpose :
-// =======================================================================
+//=================================================================================================
+
TopoDS_Shape StdPrs_BRepTextBuilder::Perform(StdPrs_BRepFont& theFont,
const NCollection_String& theString,
const gp_Ax3& thePenLoc,
} // anonymous namespace
-// =======================================================================
-// function : ExploreSolids
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_ShadedShape::ExploreSolids(const TopoDS_Shape& theShape,
const BRep_Builder& theBuilder,
TopoDS_Compound& theClosed,
}
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_ShadedShape::Add(const Handle(Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer,
theGroup);
}
-// =======================================================================
-// function : Add
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_ShadedShape::Add(const Handle(Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer,
}
}
-// =======================================================================
-// function : FillTriangles
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfTriangles) StdPrs_ShadedShape::FillTriangles(
const TopoDS_Shape& theShape,
const Standard_Boolean theHasTexels,
return fillTriangles(theShape, theHasTexels, theUVOrigin, theUVRepeat, theUVScale);
}
-// =======================================================================
-// function : FillFaceBoundaries
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfSegments) StdPrs_ShadedShape::FillFaceBoundaries(
const TopoDS_Shape& theShape,
GeomAbs_Shape theUpperContinuity)
return fillFaceBoundaries(theShape, theUpperContinuity);
}
-// =======================================================================
-// function : AddWireframeForFreeElements
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_ShadedShape::AddWireframeForFreeElements(const Handle(Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer)
wireframeFromShape(thePrs, theShape, theDrawer);
}
-// =======================================================================
-// function : AddWireframeForFacesWithoutTriangles
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_ShadedShape::AddWireframeForFacesWithoutTriangles(
const Handle(Prs3d_Presentation)& thePrs,
const TopoDS_Shape& theShape,
return BRepTools::Triangulation(theShape, GetDeflection(theShape, theDrawer), true);
}
-// =======================================================================
-// function : Tessellate
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean StdPrs_ToolTriangulatedShape::Tessellate(const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer)
{
return wasRecomputed;
}
-// =======================================================================
-// function : ClearOnOwnDeflectionChange
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdPrs_ToolTriangulatedShape::ClearOnOwnDeflectionChange(
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer,
const Standard_Real myShapeDeflection;
};
-// =========================================================================
-// function : Add
-// purpose :
-// =========================================================================
+//=================================================================================================
+
void StdPrs_WFShape::Add(const Handle(Prs3d_Presentation)& thePresentation,
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer,
}
}
-// =========================================================================
-// function : AddAllEdges
-// purpose :
-// =========================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfPrimitives) StdPrs_WFShape::AddAllEdges(
const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer)
return Prs3d::PrimitivesFromPolylines(aPolylines);
}
-// =========================================================================
-// function : addEdges
-// purpose :
-// =========================================================================
+//=================================================================================================
+
void StdPrs_WFShape::addEdges(const TopoDS_Shape& theShape,
const Handle(Prs3d_Drawer)& theDrawer,
Standard_Real theShapeDeflection,
}
}
-// =========================================================================
-// function : AddEdges
-// purpose :
-// =========================================================================
+//=================================================================================================
+
void StdPrs_WFShape::addEdges(const TopTools_ListOfShape& theEdges,
const Handle(Prs3d_Drawer)& theDrawer,
const Standard_Real theShapeDeflection,
}
}
-// =========================================================================
-// function : AddEdgesOnTriangulation
-// purpose :
-// =========================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfPrimitives) StdPrs_WFShape::AddEdgesOnTriangulation(
const TopoDS_Shape& theShape,
const Standard_Boolean theToExcludeGeometric)
return aSurfArray;
}
-// =========================================================================
-// function : AddEdgesOnTriangulation
-// purpose :
-// =========================================================================
+//=================================================================================================
+
void StdPrs_WFShape::AddEdgesOnTriangulation(TColgp_SequenceOfPnt& theSegments,
const TopoDS_Shape& theShape,
const Standard_Boolean theToExcludeGeometric)
}
}
-// =========================================================================
-// function : AddVertexes
-// purpose :
-// =========================================================================
+//=================================================================================================
+
Handle(Graphic3d_ArrayOfPoints) StdPrs_WFShape::AddVertexes(const TopoDS_Shape& theShape,
Prs3d_VertexDrawMode theVertexMode)
{
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void StdSelect_BRepOwner::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(V3d_AmbientLight, Graphic3d_CLight)
-// =======================================================================
-// function : V3d_AmbientLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_AmbientLight::V3d_AmbientLight(const Quantity_Color& theColor)
: Graphic3d_CLight(Graphic3d_TypeOfLightSource_Ambient)
{
IMPLEMENT_STANDARD_RTTIEXT(V3d_DirectionalLight, V3d_PositionLight)
-// =======================================================================
-// function : V3d_DirectionalLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_DirectionalLight::V3d_DirectionalLight(const V3d_TypeOfOrientation theDirection,
const Quantity_Color& theColor,
const Standard_Boolean theIsHeadlight)
SetDirection(V3d::GetProjAxis(theDirection));
}
-// =======================================================================
-// function : V3d_DirectionalLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_DirectionalLight::V3d_DirectionalLight(const gp_Dir& theDirection,
const Quantity_Color& theColor,
const Standard_Boolean theIsHeadlight)
SetDirection(theDirection);
}
-// =======================================================================
-// function : SetDirection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_DirectionalLight::SetDirection(V3d_TypeOfOrientation theDirection)
{
SetDirection(V3d::GetProjAxis(theDirection));
IMPLEMENT_STANDARD_RTTIEXT(V3d_Plane, Standard_Transient)
-// =======================================================================
-// function : V3d_Plane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_Plane::V3d_Plane(const Standard_Real theA,
const Standard_Real theB,
const Standard_Real theC,
{
}
-// =======================================================================
-// function : V3d_Plane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Plane::SetPlane(const Standard_Real theA,
const Standard_Real theB,
const Standard_Real theC,
}
}
-// =======================================================================
-// function : Display
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Plane::Display(const Handle(V3d_View)& theView, const Quantity_Color& theColor)
{
Handle(V3d_Viewer) aViewer = theView->Viewer();
Update();
}
-// =======================================================================
-// function : Erase
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Plane::Erase()
{
if (!myGraphicStructure.IsNull())
}
}
-// =======================================================================
-// function : Plane
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Plane::Plane(Standard_Real& theA,
Standard_Real& theB,
Standard_Real& theC,
theD = anEquation[3];
}
-// =======================================================================
-// function : IsDisplayed
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean V3d_Plane::IsDisplayed() const
{
if (myGraphicStructure.IsNull())
return myGraphicStructure->IsDisplayed();
}
-// =======================================================================
-// function : Update
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Plane::Update()
{
if (myGraphicStructure.IsNull())
IMPLEMENT_STANDARD_RTTIEXT(V3d_PositionLight, Graphic3d_CLight)
-// =======================================================================
-// function : V3d_PositionLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_PositionLight::V3d_PositionLight(Graphic3d_TypeOfLightSource theType)
: Graphic3d_CLight(theType)
{
IMPLEMENT_STANDARD_RTTIEXT(V3d_PositionalLight, V3d_PositionLight)
-// =======================================================================
-// function : V3d_PositionalLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_PositionalLight::V3d_PositionalLight(const gp_Pnt& thePos, const Quantity_Color& theColor)
: V3d_PositionLight(Graphic3d_TypeOfLightSource_Positional)
{
IMPLEMENT_STANDARD_RTTIEXT(V3d_SpotLight, V3d_PositionLight)
-// =======================================================================
-// function : V3d_SpotLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_SpotLight::V3d_SpotLight(const gp_Pnt& thePos,
const V3d_TypeOfOrientation theDirection,
const Quantity_Color& theColor)
SetDirection(V3d::GetProjAxis(theDirection));
}
-// =======================================================================
-// function : V3d_SpotLight
-// purpose :
-// =======================================================================
+//=================================================================================================
+
V3d_SpotLight::V3d_SpotLight(const gp_Pnt& thePos,
const gp_Dir& theDirection,
const Quantity_Color& theColor)
SetDirection(theDirection);
}
-// =======================================================================
-// function : SetDirection
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_SpotLight::SetDirection(V3d_TypeOfOrientation theDirection)
{
SetDirection(V3d::GetProjAxis(theDirection));
V3d_Trihedron* myTrihedron;
};
-// ============================================================================
-// function : V3d_Trihedron
-// purpose :
-// ============================================================================
+//=================================================================================================
+
V3d_Trihedron::V3d_Trihedron()
: myScale(1.0),
myRatio(0.8),
mySphereShadingAspect->SetColor(Quantity_NOC_WHITE);
}
-// ============================================================================
-// function : V3d_Trihedron
-// purpose :
-// ============================================================================
+//=================================================================================================
+
V3d_Trihedron::~V3d_Trihedron()
{
Erase();
}
-// ============================================================================
-// function : SetLabelsColor
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetLabelsColor(const Quantity_Color& theColor)
{
myTextAspects[V3d_X]->SetColor(theColor);
myTextAspects[V3d_Z]->SetColor(theColor);
}
-// ============================================================================
-// function : SetLabels
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetLabels(const TCollection_AsciiString& theX,
const TCollection_AsciiString& theY,
const TCollection_AsciiString& theZ)
}
}
-// ============================================================================
-// function : SetLabelsColor
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetLabelsColor(const Quantity_Color& theXColor,
const Quantity_Color& theYColor,
const Quantity_Color& theZColor)
myTextAspects[V3d_Z]->SetColor(theZColor);
}
-// ============================================================================
-// function : SetArrowsColor
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetArrowsColor(const Quantity_Color& theXColor,
const Quantity_Color& theYColor,
const Quantity_Color& theZColor)
}
}
-// ============================================================================
-// function : SetScale
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetScale(const Standard_Real theScale)
{
if (Abs(myScale - theScale) > Precision::Confusion())
myScale = theScale;
}
-// =======================================================================
-// function : SetSizeRatio
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetSizeRatio(const Standard_Real theRatio)
{
if (Abs(myRatio - theRatio) > Precision::Confusion())
myRatio = theRatio;
}
-// =======================================================================
-// function : SetArrowDiameter
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetArrowDiameter(const Standard_Real theDiam)
{
if (Abs(myDiameter - theDiam) > Precision::Confusion())
myDiameter = theDiam;
}
-// =======================================================================
-// function : SetNbFacets
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetNbFacets(const Standard_Integer theNbFacets)
{
if (Abs(myNbFacettes - theNbFacets) > 0)
myNbFacettes = theNbFacets;
}
-// ============================================================================
-// function : Display
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::Display(const V3d_View& theView)
{
if (myStructure.IsNull())
myStructure->Display();
}
-// ============================================================================
-// function : Erase
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::Erase()
{
if (!myStructure.IsNull())
}
}
-// ============================================================================
-// function : SetPosition
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::SetPosition(const Aspect_TypeOfTriedronPosition thePosition)
{
Graphic3d_Vec2i anOffset(0, 0);
myTransformPers->SetOffset2d(anOffset);
}
-// ============================================================================
-// function : compute
-// purpose :
-// ============================================================================
+//=================================================================================================
+
void V3d_Trihedron::compute()
{
myToCompute = Standard_False;
MyWindow.Nullify();
}
-// =======================================================================
-// function : AddSubview
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_View::AddSubview(const Handle(V3d_View)& theView)
{
mySubviews.Append(theView);
}
-// =======================================================================
-// function : RemoveSubview
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool V3d_View::RemoveSubview(const V3d_View* theView)
{
for (NCollection_Sequence<Handle(V3d_View)>::Iterator aViewIter(mySubviews); aViewIter.More();
return false;
}
-// =============================================================================
-// function : PickSubview
-// purpose :
-// =============================================================================
+//=================================================================================================
+
Handle(V3d_View) V3d_View::PickSubview(const Graphic3d_Vec2i& thePnt) const
{
if (thePnt.x() < 0 || thePnt.x() >= MyWindow->Dimensions().x() || thePnt.y() < 0
return !myView->IsDefined() || myView->IsInvalidated();
}
-// ========================================================================
-// function : SetAutoZFitMode
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_View::SetAutoZFitMode(const Standard_Boolean theIsOn, const Standard_Real theScaleFactor)
{
Standard_ASSERT_RAISE(theScaleFactor > 0.0, "Zero or negative scale factor is not allowed.");
return aPreviousMode;
}
-// =======================================================================
-// function : SetCamera
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_View::SetCamera(const Handle(Graphic3d_Camera)& theCamera)
{
myView->SetCamera(theCamera);
ImmediateUpdate();
}
-// =======================================================================
-// function : GetCamera
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Handle(Graphic3d_Camera)& V3d_View::Camera() const
{
return myView->Camera();
}
-// =======================================================================
-// function : FitMinMax
-// purpose : Internal
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean V3d_View::FitMinMax(const Handle(Graphic3d_Camera)& theCamera,
const Bnd_Box& theBox,
const Standard_Real theMargin,
return Standard_True;
}
-// =======================================================================
-// function : Scale
-// purpose : Internal
-// =======================================================================
+//=================================================================================================
+
void V3d_View::Scale(const Handle(Graphic3d_Camera)& theCamera,
const Standard_Real theSizeXv,
const Standard_Real theSizeYv) const
Invalidate();
}
-// =======================================================================
-// function : Translate
-// purpose : Internal
-// =======================================================================
+//=================================================================================================
+
void V3d_View::Translate(const Handle(Graphic3d_Camera)& theCamera,
const Standard_Real theDXv,
const Standard_Real theDYv) const
Invalidate();
}
-// =======================================================================
-// function : DiagnosticInformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_View::DiagnosticInformation(TColStd_IndexedDataMapOfStringString& theDict,
Graphic3d_DiagnosticInfo theFlags) const
{
myView->StatisticInformation(theDict);
}
-// =======================================================================
-// function : StatisticInformation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString V3d_View::StatisticInformation() const
{
return myView->StatisticInformation();
myView->GraduatedTrihedronErase();
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_View::DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth) const
{
OCCT_DUMP_TRANSIENT_CLASS_BEGIN(theOStream)
IMPLEMENT_STANDARD_RTTIEXT(V3d_Viewer, Standard_Transient)
-// ========================================================================
-// function : V3d_Viewer
-// purpose :
-// ========================================================================
+//=================================================================================================
+
V3d_Viewer::V3d_Viewer(const Handle(Graphic3d_GraphicDriver)& theDriver)
: myDriver(theDriver),
myStructureManager(new Graphic3d_StructureManager(theDriver)),
//
}
-// ========================================================================
-// function : CreateView
-// purpose :
-// ========================================================================
+//=================================================================================================
+
Handle(V3d_View) V3d_Viewer::CreateView()
{
return new V3d_View(this, myDefaultTypeOfView);
}
-// ========================================================================
-// function : SetViewOn
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::SetViewOn()
{
for (V3d_ListOfView::Iterator aDefViewIter(myDefinedViews); aDefViewIter.More();
}
}
-// ========================================================================
-// function : SetViewOff
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::SetViewOff()
{
for (V3d_ListOfView::Iterator aDefViewIter(myDefinedViews); aDefViewIter.More();
}
}
-// ========================================================================
-// function : SetViewOn
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::SetViewOn(const Handle(V3d_View)& theView)
{
Handle(Graphic3d_CView) aViewImpl = theView->View();
}
}
-// ========================================================================
-// function : SetViewOff
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::SetViewOff(const Handle(V3d_View)& theView)
{
Handle(Graphic3d_CView) aViewImpl = theView->View();
}
}
-// ========================================================================
-// function : Redraw
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::Redraw() const
{
for (int aSubViewPass = 0; aSubViewPass < 2; ++aSubViewPass)
}
}
-// ========================================================================
-// function : RedrawImmediate
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::RedrawImmediate() const
{
for (int aSubViewPass = 0; aSubViewPass < 2; ++aSubViewPass)
}
}
-// ========================================================================
-// function : Invalidate
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::Invalidate() const
{
for (V3d_ListOfView::Iterator aDefViewIter(myDefinedViews); aDefViewIter.More();
}
}
-// ========================================================================
-// function : Remove
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::Remove()
{
myStructureManager->Remove();
}
-// ========================================================================
-// function : Erase
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::Erase() const
{
myStructureManager->Erase();
}
-// ========================================================================
-// function : UnHighlight
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::UnHighlight() const
{
myStructureManager->UnHighlight();
myViewSize = theSize;
}
-// ========================================================================
-// function : IfMoreViews
-// purpose :
-// ========================================================================
+//=================================================================================================
+
Standard_Boolean V3d_Viewer::IfMoreViews() const
{
return myDefinedViews.Size() < myStructureManager->MaxNumOfViews();
}
-// ========================================================================
-// function : AddView
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::AddView(const Handle(V3d_View)& theView)
{
if (!myDefinedViews.Contains(theView))
}
}
-// ========================================================================
-// function : DelView
-// purpose :
-// ========================================================================
+//=================================================================================================
+
void V3d_Viewer::DelView(const V3d_View* theView)
{
for (V3d_ListOfView::Iterator aViewIter(myActiveViews); aViewIter.More(); aViewIter.Next())
myPlaneStructure->Display();
}
-// =======================================================================
-// function : Grid
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(Aspect_Grid) V3d_Viewer::Grid(Aspect_GridType theGridType, bool theToCreate)
{
switch (theGridType)
return Handle(Aspect_Grid)();
}
-// =======================================================================
-// function : GridDrawMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_GridDrawMode V3d_Viewer::GridDrawMode()
{
Handle(Aspect_Grid) aGrid = Grid(false);
return !aGrid.IsNull() ? aGrid->DrawMode() : Aspect_GDM_Lines;
}
-// =======================================================================
-// function : ActivateGrid
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::ActivateGrid(const Aspect_GridType theType, const Aspect_GridDrawMode theMode)
{
if (Handle(Aspect_Grid) anOldGrid = Grid(false))
}
}
-// =======================================================================
-// function : DeactivateGrid
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::DeactivateGrid()
{
Handle(Aspect_Grid) aGrid = Grid(false);
}
}
-// =======================================================================
-// function : IsGridActive
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean V3d_Viewer::IsGridActive()
{
Handle(Aspect_Grid) aGrid = Grid(false);
return !aGrid.IsNull() && aGrid->IsActive();
}
-// =======================================================================
-// function : RectangularGridValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::RectangularGridValues(Standard_Real& theXOrigin,
Standard_Real& theYOrigin,
Standard_Real& theXStep,
theRotationAngle = myRGrid->RotationAngle();
}
-// =======================================================================
-// function : SetRectangularGridValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::SetRectangularGridValues(const Standard_Real theXOrigin,
const Standard_Real theYOrigin,
const Standard_Real theXStep,
}
}
-// =======================================================================
-// function : CircularGridValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::CircularGridValues(Standard_Real& theXOrigin,
Standard_Real& theYOrigin,
Standard_Real& theRadiusStep,
theRotationAngle = myCGrid->RotationAngle();
}
-// =======================================================================
-// function : SetCircularGridValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::SetCircularGridValues(const Standard_Real theXOrigin,
const Standard_Real theYOrigin,
const Standard_Real theRadiusStep,
}
}
-// =======================================================================
-// function : RectangularGridGraphicValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::RectangularGridGraphicValues(Standard_Real& theXSize,
Standard_Real& theYSize,
Standard_Real& theOffSet)
myRGrid->GraphicValues(theXSize, theYSize, theOffSet);
}
-// =======================================================================
-// function : SetRectangularGridGraphicValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::SetRectangularGridGraphicValues(const Standard_Real theXSize,
const Standard_Real theYSize,
const Standard_Real theOffSet)
myRGrid->SetGraphicValues(theXSize, theYSize, theOffSet);
}
-// =======================================================================
-// function : CircularGridGraphicValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::CircularGridGraphicValues(Standard_Real& theRadius, Standard_Real& theOffSet)
{
Grid(Aspect_GT_Circular, true);
myCGrid->GraphicValues(theRadius, theOffSet);
}
-// =======================================================================
-// function : SetCircularGridGraphicValues
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::SetCircularGridGraphicValues(const Standard_Real theRadius,
const Standard_Real theOffSet)
{
myCGrid->SetGraphicValues(theRadius, theOffSet);
}
-// =======================================================================
-// function : SetGridEcho
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::SetGridEcho(const Standard_Boolean theToShowGrid)
{
if (myGridEcho == theToShowGrid)
myGridEchoStructure->Erase();
}
-// =======================================================================
-// function : SetGridEcho
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::SetGridEcho(const Handle(Graphic3d_AspectMarker3d)& theMarker)
{
if (myGridEchoStructure.IsNull())
myGridEchoGroup->SetPrimitivesAspect(theMarker);
}
-// =======================================================================
-// function : ShowGridEcho
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::ShowGridEcho(const Handle(V3d_View)& theView, const Graphic3d_Vertex& theVertex)
{
if (!myGridEcho)
myGridEchoStructure->Display();
}
-// =======================================================================
-// function : HideGridEcho
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void V3d_Viewer::HideGridEcho(const Handle(V3d_View)& theView)
{
if (myGridEchoStructure.IsNull())
return Standard_True;
}
-// =============================================================================
-// function : ParseCorner
-// purpose :
-// =============================================================================
+//=================================================================================================
+
Standard_Boolean ViewerTest::ParseCorner(Standard_CString theArg,
Aspect_TypeOfTriedronPosition& theCorner)
{
#include <OSD_Timer.hxx>
#include <V3d_View.hxx>
-// =======================================================================
-// function : Instance
-// purpose :
-// =======================================================================
+//=================================================================================================
+
ViewerTest_ContinuousRedrawer& ViewerTest_ContinuousRedrawer::Instance()
{
static ViewerTest_ContinuousRedrawer aRedrawer;
return aRedrawer;
}
-// =======================================================================
-// function : ViewerTest_ContinuousRedrawer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
ViewerTest_ContinuousRedrawer::ViewerTest_ContinuousRedrawer()
: myThread(doThreadWrapper),
myWakeEvent(false),
//
}
-// =======================================================================
-// function : ~ViewerTest_ContinuousRedrawer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
ViewerTest_ContinuousRedrawer::~ViewerTest_ContinuousRedrawer()
{
Stop();
}
-// =======================================================================
-// function : Start
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void ViewerTest_ContinuousRedrawer::Start(const Handle(V3d_View)& theView,
Standard_Real theTargetFps)
{
}
}
-// =======================================================================
-// function : Stop
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void ViewerTest_ContinuousRedrawer::Stop(const Handle(V3d_View)& theView)
{
if (!theView.IsNull() && myView != theView)
myView.Nullify();
}
-// =======================================================================
-// function : Pause
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void ViewerTest_ContinuousRedrawer::Pause()
{
if (!myToPause)
}
}
-// =======================================================================
-// function : doThreadLoop
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void ViewerTest_ContinuousRedrawer::doThreadLoop()
{
Handle(Aspect_DisplayConnection) aDisp = new Aspect_DisplayConnection();
}
}
-// =======================================================================
-// function : UpdateMouseClick
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool ViewerTest_EventManager::UpdateMouseClick(const Graphic3d_Vec2i& thePoint,
Aspect_VKeyMouse theButton,
Aspect_VKeyFlags theModifiers,
#endif
}
-// =======================================================================
-// function : navigationKeyModifierSwitch
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool ViewerTest_EventManager::navigationKeyModifierSwitch(unsigned int theModifOld,
unsigned int theModifNew,
double theTimeStamp)
}
#endif
-// ==============================================================================
-// function : SetupWindowCallbacks
-// purpose :
-// ==============================================================================
+//=================================================================================================
+
void ViewerTest_EventManager::SetupWindowCallbacks(const Handle(Aspect_Window)& theWin)
{
#ifdef _WIN32
IMPLEMENT_STANDARD_RTTIEXT(ViewerTest_V3dView, V3d_View)
-// =======================================================================
-// function : ViewerTest_V3dView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
ViewerTest_V3dView::ViewerTest_V3dView(const Handle(V3d_Viewer)& theViewer,
const V3d_TypeOfView theType,
bool theIs2dMode)
//
}
-// =======================================================================
-// function : ViewerTest_V3dView
-// purpose :
-// =======================================================================
+//=================================================================================================
+
ViewerTest_V3dView::ViewerTest_V3dView(const Handle(V3d_Viewer)& theViewer,
const Handle(V3d_View)& theView)
: V3d_View(theViewer, theView),
}
}
-// =======================================================================
-// function : IsCurrentViewIn2DMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool ViewerTest_V3dView::IsCurrentViewIn2DMode()
{
if (Handle(ViewerTest_V3dView) aV3dView =
return false;
}
-// =======================================================================
-// function : SetCurrentView2DMode
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void ViewerTest_V3dView::SetCurrentView2DMode(bool theIs2d)
{
if (Handle(ViewerTest_V3dView) aV3dView =
}
}
#elif !defined(__APPLE__)
-// =======================================================================
-// function : ViewerMainLoop
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int ViewerMainLoop(Standard_Integer, const char**)
{
// unused
return 0;
}
-// ==============================================================================
-// function : VReadPixel
-// purpose :
-// ==============================================================================
+//=================================================================================================
+
static int VReadPixel(Draw_Interpretor& theDI, Standard_Integer theArgNb, const char** theArgVec)
{
// get the active view
} // namespace
-// =======================================================================
-// function : WNT_HIDSpaceMouse
-// purpose :
-// =======================================================================
+//=================================================================================================
+
WNT_HIDSpaceMouse::WNT_HIDSpaceMouse(unsigned long theProductId,
const Standard_Byte* theData,
Standard_Size theSize)
//
}
-// =======================================================================
-// function : IsKnownProduct
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool WNT_HIDSpaceMouse::IsKnownProduct(unsigned long theProductId)
{
switch (theProductId)
return false;
}
-// =======================================================================
-// function : Translation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec3d WNT_HIDSpaceMouse::Translation(bool& theIsIdle, bool theIsQuadric) const
{
theIsIdle = true;
: Graphic3d_Vec3d();
}
-// =======================================================================
-// function : Rotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec3d WNT_HIDSpaceMouse::Rotation(bool& theIsIdle, bool theIsQuadric) const
{
theIsIdle = true;
return Graphic3d_Vec3d();
}
-// =======================================================================
-// function : fromRawVec3
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Graphic3d_Vec3d WNT_HIDSpaceMouse::fromRawVec3(bool& theIsIdle,
const Standard_Byte* theData,
bool theIsTrans,
return aVec / (double(myValueRange) * double(myValueRange));
}
-// =======================================================================
-// function : HidToSpaceKey
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKey WNT_HIDSpaceMouse::HidToSpaceKey(unsigned short theKeyBit) const
{
const SpaceVKey aKey = hidToSpaceKey(myProductId, theKeyBit);
bool myIsRegistered;
};
-// =======================================================================
-// function : WNT_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
WNT_Window::WNT_Window(const Standard_CString theTitle,
const Handle(WNT_WClass)& theClass,
const WNT_Dword& theStyle,
SetBackground(theBackColor);
}
-// =======================================================================
-// function : WNT_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
WNT_Window::WNT_Window(const Aspect_Handle theHandle, const Quantity_NameOfColor theBackColor)
: myHWindow(theHandle),
myHParentWindow(GetParent((HWND)theHandle)),
myYBottom = aPlace.rcNormalPosition.bottom;
}
-// =======================================================================
-// function : ~WNT_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
WNT_Window::~WNT_Window()
{
if (myHWindow == NULL || myIsForeign)
myIsForeign = Standard_False;
}
-// =======================================================================
-// function : SetCursor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::SetCursor(const Aspect_Handle theCursor) const
{
::SetClassLongPtrW((HWND)myHWindow, GCLP_HCURSOR, (LONG_PTR)theCursor);
}
-// =======================================================================
-// function : IsMapped
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean WNT_Window::IsMapped() const
{
if (IsVirtual())
return !(aPlace.showCmd == SW_HIDE || aPlace.showCmd == SW_MINIMIZE);
}
-// =======================================================================
-// function : Map
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::Map() const
{
if (!IsVirtual())
}
}
-// =======================================================================
-// function : Map
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::Map(const Standard_Integer theMapMode) const
{
if (IsVirtual())
::UpdateWindow((HWND)myHWindow);
}
-// =======================================================================
-// function : Unmap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::Unmap() const
{
Map(SW_HIDE);
}
-// =======================================================================
-// function : DoResize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_TypeOfResize WNT_Window::DoResize()
{
if (IsVirtual())
return Aspect_TOR_UNKNOWN;
}
-// =======================================================================
-// function : Ratio
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real WNT_Window::Ratio() const
{
if (IsVirtual())
return Standard_Real(aRect.right - aRect.left) / Standard_Real(aRect.bottom - aRect.top);
}
-// =======================================================================
-// function : Position
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::Position(Standard_Integer& theX1,
Standard_Integer& theY1,
Standard_Integer& theX2,
theY2 = aPntRight.y;
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::Size(Standard_Integer& theWidth, Standard_Integer& theHeight) const
{
if (IsVirtual())
theHeight = aRect.bottom;
}
-// =======================================================================
-// function : SetPos
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::SetPos(const Standard_Integer theX,
const Standard_Integer theY,
const Standard_Integer theX1,
myYBottom = theY1;
}
-// =======================================================================
-// function : SetTitle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::SetTitle(const TCollection_AsciiString& theTitle)
{
const TCollection_ExtendedString aTitleW(theTitle);
SetWindowTextW((HWND)myHWindow, aTitleW.ToWideString());
}
-// =======================================================================
-// function : InvalidateContent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void WNT_Window::InvalidateContent(const Handle(Aspect_DisplayConnection)&)
{
if (myHWindow != NULL)
}
}
-// =======================================================================
-// function : VirtualKeyFromNative
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKey WNT_Window::VirtualKeyFromNative(Standard_Integer theKey)
{
if (theKey >= Standard_Integer('0') && theKey <= Standard_Integer('9'))
return Aspect_VKey_UNKNOWN;
}
-// =======================================================================
-// function : MouseKeyFlagsFromEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKeyFlags WNT_Window::MouseKeyFlagsFromEvent(WPARAM theKeys)
{
Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE;
return aFlags;
}
-// =======================================================================
-// function : MouseKeyFlagsAsync
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKeyFlags WNT_Window::MouseKeyFlagsAsync()
{
Aspect_VKeyFlags aFlags = Aspect_VKeyFlags_NONE;
return aFlags;
}
-// =======================================================================
-// function : MouseButtonsFromEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKeyMouse WNT_Window::MouseButtonsFromEvent(WPARAM theKeys)
{
Aspect_VKeyMouse aButtons = Aspect_VKeyMouse_NONE;
return aButtons;
}
-// =======================================================================
-// function : MouseButtonsAsync
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKeyMouse WNT_Window::MouseButtonsAsync()
{
Aspect_VKeyMouse aButtons = Aspect_VKeyMouse_NONE;
return aButtons;
}
-// =======================================================================
-// function : RegisterRawInputDevices
-// purpose :
-// =======================================================================
+//=================================================================================================
+
int WNT_Window::RegisterRawInputDevices(unsigned int theRawDeviceMask)
{
if (IsVirtual() || myHWindow == NULL)
return 0;
}
-// =======================================================================
-// function : ProcessMessage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool WNT_Window::ProcessMessage(Aspect_WindowInputListener& theListener, MSG& theMsg)
{
if (myTouchInputHelper.IsNull())
IMPLEMENT_STANDARD_RTTIEXT(Wasm_Window, Aspect_Window)
-// =======================================================================
-// function : Wasm_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Wasm_Window::Wasm_Window(const TCollection_AsciiString& theCanvasId, const bool theToScaleBacking)
: myCanvasId(theCanvasId),
mySize(0),
#endif
}
-// =======================================================================
-// function : ~Wasm_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Wasm_Window::~Wasm_Window()
{
//
}
-// =======================================================================
-// function : DoResize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_TypeOfResize Wasm_Window::DoResize()
{
if (IsVirtual())
return Aspect_TOR_UNKNOWN;
}
-// =======================================================================
-// function : Ratio
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Wasm_Window::Ratio() const
{
Graphic3d_Vec2i aCanvasSize = mySize;
: 1.0;
}
-// =======================================================================
-// function : Position
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Wasm_Window::Position(Standard_Integer& theX1,
Standard_Integer& theY1,
Standard_Integer& theX2,
#endif
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Wasm_Window::Size(Standard_Integer& theWidth, Standard_Integer& theHeight) const
{
if (IsVirtual())
#endif
}
-// =======================================================================
-// function : SetSizeLogical
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Wasm_Window::SetSizeLogical(const Graphic3d_Vec2d& theSize)
{
mySize = Graphic3d_Vec2i(theSize * myDevicePixelRatio);
#endif
}
-// =======================================================================
-// function : SetSizeBacking
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Wasm_Window::SetSizeBacking(const Graphic3d_Vec2i& theSize)
{
mySize = theSize;
#endif
}
-// =======================================================================
-// function : InvalidateContent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Wasm_Window::InvalidateContent(const Handle(Aspect_DisplayConnection)&)
{
//
}
-// =======================================================================
-// function : ProcessMessage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Wasm_Window::ProcessMessage(Aspect_WindowInputListener& theListener,
int theEventType,
const void* theEvent)
#endif
}
-// =======================================================================
-// function : ProcessMouseEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Wasm_Window::ProcessMouseEvent(Aspect_WindowInputListener& theListener,
int theEventType,
const EmscriptenMouseEvent* theEvent)
#endif
}
-// =======================================================================
-// function : ProcessWheelEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Wasm_Window::ProcessWheelEvent(Aspect_WindowInputListener& theListener,
int theEventType,
const EmscriptenWheelEvent* theEvent)
#endif
}
-// =======================================================================
-// function : ProcessTouchEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Wasm_Window::ProcessTouchEvent(Aspect_WindowInputListener& theListener,
int theEventType,
const EmscriptenTouchEvent* theEvent)
return hasUpdates || theListener.HasTouchPoints();
}
-// =======================================================================
-// function : ProcessKeyEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Wasm_Window::ProcessKeyEvent(Aspect_WindowInputListener& theListener,
int theEventType,
const EmscriptenKeyboardEvent* theEvent)
return false;
}
-// =======================================================================
-// function : ProcessUiEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Wasm_Window::ProcessUiEvent(Aspect_WindowInputListener& theListener,
int theEventType,
const EmscriptenUiEvent*)
return true;
}
-// =======================================================================
-// function : ProcessFocusEvent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Wasm_Window::ProcessFocusEvent(Aspect_WindowInputListener& theListener,
int theEventType,
const EmscriptenFocusEvent*)
return true;
}
-// =======================================================================
-// function : MouseButtonsFromNative
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKeyMouse Wasm_Window::MouseButtonsFromNative(unsigned short theButtons)
{
Aspect_VKeyMouse aButtons = Aspect_VKeyMouse_NONE;
return aButtons;
}
-// =======================================================================
-// function : VirtualKeyFromNative
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKey Wasm_Window::VirtualKeyFromNative(Standard_Integer theKey)
{
#if defined(__EMSCRIPTEN__)
return aNumLinks;
}
-// =======================================================================
-// function : GetUsageOccurrenceQuantity
-// purpose :
-// =======================================================================
+//=================================================================================================
Standard_Integer XCAFDoc_AssemblyGraph::NbOccurrences(const Standard_Integer theNode) const
{
return Extract(aSeq, theDstLabel, theIsNoVisMat);
}
-// =======================================================================
-// function : CloneShapeLebel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_Editor::CloneShapeLabel(const TDF_Label& theSrcLabel,
const Handle(XCAFDoc_ShapeTool)& theSrcShapeTool,
const Handle(XCAFDoc_ShapeTool)& theDstShapeTool,
ChildLab_Presentation
};
-// =======================================================================
-// function : IsMine
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_Note::IsMine(const TDF_Label& theLabel)
{
return !Get(theLabel).IsNull();
}
-// =======================================================================
-// function : XCAFDoc_Note
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFDoc_Note::XCAFDoc_Note() {}
-// =======================================================================
-// function : Get
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_Note) XCAFDoc_Note::Get(const TDF_Label& theLabel)
{
Handle(XCAFDoc_Note) aNote;
return aNote;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_Note::Set(const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp)
{
myTimeStamp = theTimeStamp;
}
-// =======================================================================
-// function : IsOrphan
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_Note::IsOrphan() const
{
Handle(XCAFDoc_GraphNode) aFather;
return !Label().FindAttribute(XCAFDoc::NoteRefGUID(), aFather) || (aFather->NbChildren() == 0);
}
-// =======================================================================
-// function : GetObject
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFNoteObjects_NoteObject) XCAFDoc_Note::GetObject() const
{
Handle(XCAFNoteObjects_NoteObject) anObj = new XCAFNoteObjects_NoteObject();
return anObj;
}
-// =======================================================================
-// function : SetObject
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_Note::SetObject(const Handle(XCAFNoteObjects_NoteObject)& theObject)
{
Backup();
}
}
-// =======================================================================
-// function : Restore
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_Note::Restore(const Handle(TDF_Attribute)& theAttr)
{
myUserName = Handle(XCAFDoc_Note)::DownCast(theAttr)->myUserName;
myTimeStamp = Handle(XCAFDoc_Note)::DownCast(theAttr)->myTimeStamp;
}
-// =======================================================================
-// function : Paste
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_Note::Paste(const Handle(TDF_Attribute)& theAttrInto,
const Handle(TDF_RelocationTable)& /*theRT*/) const
{
Handle(XCAFDoc_Note)::DownCast(theAttrInto)->Set(myUserName, myTimeStamp);
}
-// =======================================================================
-// function : Dump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_OStream& XCAFDoc_Note::Dump(Standard_OStream& theOS) const
{
TDF_Attribute::Dump(theOS);
IMPLEMENT_DERIVED_ATTRIBUTE(XCAFDoc_NoteBalloon, XCAFDoc_NoteComment)
-// =======================================================================
-// function : GetID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NoteBalloon::GetID()
{
static Standard_GUID s_ID("1127951D-87D5-4ecc-89D5-D1406576C43F");
return s_ID;
}
-// =======================================================================
-// function : Get
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NoteBalloon) XCAFDoc_NoteBalloon::Get(const TDF_Label& theLabel)
{
Handle(XCAFDoc_NoteBalloon) aThis;
return aThis;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NoteBalloon) XCAFDoc_NoteBalloon::Set(const TDF_Label& theLabel,
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
return aNoteBalloon;
}
-// =======================================================================
-// function : XCAFDoc_NoteBalloon
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFDoc_NoteBalloon::XCAFDoc_NoteBalloon() {}
-// =======================================================================
-// function : ID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NoteBalloon::ID() const
{
return GetID();
IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NoteBinData, XCAFDoc_Note)
-// =======================================================================
-// function : GetID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NoteBinData::GetID()
{
static Standard_GUID s_ID("E9055501-F0FC-4864-BE4B-284FDA7DDEAC");
return s_ID;
}
-// =======================================================================
-// function : Get
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NoteBinData) XCAFDoc_NoteBinData::Get(const TDF_Label& theLabel)
{
Handle(XCAFDoc_NoteBinData) aThis;
return aThis;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NoteBinData) XCAFDoc_NoteBinData::Set(const TDF_Label& theLabel,
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
return aNoteBinData;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NoteBinData) XCAFDoc_NoteBinData::Set(const TDF_Label& theLabel,
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
return aNoteBinData;
}
-// =======================================================================
-// function : XCAFDoc_NoteBinData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFDoc_NoteBinData::XCAFDoc_NoteBinData() {}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle,
const TCollection_AsciiString& theMIMEtype,
OSD_File& theFile)
return Standard_True;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NoteBinData::Set(const TCollection_ExtendedString& theTitle,
const TCollection_AsciiString& theMIMEtype,
const Handle(TColStd_HArray1OfByte)& theData)
myMIMEtype = theMIMEtype;
}
-// =======================================================================
-// function : ID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NoteBinData::ID() const
{
return GetID();
}
-// =======================================================================
-// function : NewEmpty
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(TDF_Attribute) XCAFDoc_NoteBinData::NewEmpty() const
{
return new XCAFDoc_NoteBinData();
}
-// =======================================================================
-// function : Restore
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NoteBinData::Restore(const Handle(TDF_Attribute)& theAttr)
{
XCAFDoc_Note::Restore(theAttr);
}
}
-// =======================================================================
-// function : Paste
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NoteBinData::Paste(const Handle(TDF_Attribute)& theAttrInto,
const Handle(TDF_RelocationTable)& theRT) const
{
aMine->Set(myTitle, myMIMEtype, myData);
}
-// =======================================================================
-// function : Dump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_OStream& XCAFDoc_NoteBinData::Dump(Standard_OStream& theOS) const
{
XCAFDoc_Note::Dump(theOS);
IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NoteComment, XCAFDoc_Note)
-// =======================================================================
-// function : GetID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NoteComment::GetID()
{
static Standard_GUID s_ID("FDEA4C52-0F54-484c-B590-579E18F7B5D4");
return s_ID;
}
-// =======================================================================
-// function : Get
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NoteComment) XCAFDoc_NoteComment::Get(const TDF_Label& theLabel)
{
Handle(XCAFDoc_NoteComment) aThis;
return aThis;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NoteComment) XCAFDoc_NoteComment::Set(const TDF_Label& theLabel,
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
return aNoteComment;
}
-// =======================================================================
-// function : XCAFDoc_NoteComment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFDoc_NoteComment::XCAFDoc_NoteComment() {}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NoteComment::Set(const TCollection_ExtendedString& theComment)
{
Backup();
myComment = theComment;
}
-// =======================================================================
-// function : ID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NoteComment::ID() const
{
return GetID();
}
-// =======================================================================
-// function : NewEmpty
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(TDF_Attribute) XCAFDoc_NoteComment::NewEmpty() const
{
return new XCAFDoc_NoteComment();
}
-// =======================================================================
-// function : Restore
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NoteComment::Restore(const Handle(TDF_Attribute)& theAttr)
{
XCAFDoc_Note::Restore(theAttr);
myComment = aMine->myComment;
}
-// =======================================================================
-// function : Paste
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NoteComment::Paste(const Handle(TDF_Attribute)& theAttrInto,
const Handle(TDF_RelocationTable)& theRT) const
{
aMine->Set(myComment);
}
-// =======================================================================
-// function : Dump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_OStream& XCAFDoc_NoteComment::Dump(Standard_OStream& theOS) const
{
XCAFDoc_Note::Dump(theOS);
NotesTool_AnnotatedItemsRoot
};
-// =======================================================================
-// function : GetID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NotesTool::GetID()
{
static Standard_GUID s_ID("8F8174B1-6125-47a0-B357-61BD2D89380C");
return s_ID;
}
-// =======================================================================
-// function : Set
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_NotesTool) XCAFDoc_NotesTool::Set(const TDF_Label& theLabel)
{
Handle(XCAFDoc_NotesTool) aTool;
return aTool;
}
-// =======================================================================
-// function : XCAFDoc_NotesTool
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFDoc_NotesTool::XCAFDoc_NotesTool() {}
-// =======================================================================
-// function : GetNotesLabel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::GetNotesLabel() const
{
return Label().FindChild(NotesTool_NotesRoot);
}
-// =======================================================================
-// function : GetAnnotatedItemsLabel
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::GetAnnotatedItemsLabel() const
{
return Label().FindChild(NotesTool_AnnotatedItemsRoot);
}
-// =======================================================================
-// function : NbNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::NbNotes() const
{
Standard_Integer nbNotes = 0;
return nbNotes;
}
-// =======================================================================
-// function : NbAnnotatedItems
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::NbAnnotatedItems() const
{
Standard_Integer nbItems = 0;
return nbItems;
}
-// =======================================================================
-// function : GetNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NotesTool::GetNotes(TDF_LabelSequence& theNoteLabels) const
{
for (TDF_ChildIterator anIter(GetNotesLabel()); anIter.More(); anIter.Next())
}
}
-// =======================================================================
-// function : GetAnnotatedItems
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NotesTool::GetAnnotatedItems(TDF_LabelSequence& theItemLabels) const
{
for (TDF_ChildIDIterator anIter(GetAnnotatedItemsLabel(), XCAFDoc_AssemblyItemRef::GetID());
}
}
-// =======================================================================
-// function : IsAnnotatedItem
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::IsAnnotatedItem(const XCAFDoc_AssemblyItemId& theItemId) const
{
return !FindAnnotatedItem(theItemId).IsNull();
}
-// =======================================================================
-// function : IsAnnotatedItem
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::IsAnnotatedItem(const TDF_Label& theItemLabel) const
{
return IsAnnotatedItem(labeledItem(theItemLabel));
}
-// =======================================================================
-// function : FindAnnotatedItem
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::FindAnnotatedItem(const XCAFDoc_AssemblyItemId& theItemId) const
{
for (TDF_ChildIDIterator anIter(GetAnnotatedItemsLabel(), XCAFDoc_AssemblyItemRef::GetID());
return TDF_Label();
}
-// =======================================================================
-// function : FindAnnotatedItem
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::FindAnnotatedItem(const TDF_Label& theItemLabel) const
{
return FindAnnotatedItem(labeledItem(theItemLabel));
}
-// =======================================================================
-// function : FindAnnotatedItemAttr
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::FindAnnotatedItemAttr(const XCAFDoc_AssemblyItemId& theItemId,
const Standard_GUID& theGUID) const
{
return TDF_Label();
}
-// =======================================================================
-// function : FindAnnotatedItemAttr
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::FindAnnotatedItemAttr(const TDF_Label& theItemLabel,
const Standard_GUID& theGUID) const
{
return FindAnnotatedItemAttr(labeledItem(theItemLabel), theGUID);
}
-// =======================================================================
-// function : FindAnnotatedItemSubshape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::FindAnnotatedItemSubshape(const XCAFDoc_AssemblyItemId& theItemId,
Standard_Integer theSubshapeIndex) const
{
return TDF_Label();
}
-// =======================================================================
-// function : FindAnnotatedItemSubshape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFDoc_NotesTool::FindAnnotatedItemSubshape(const TDF_Label& theItemLabel,
Standard_Integer theSubshapeIndex) const
{
return FindAnnotatedItemSubshape(labeledItem(theItemLabel), theSubshapeIndex);
}
-// =======================================================================
-// function : CreateComment
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_Note) XCAFDoc_NotesTool::CreateComment(
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
return XCAFDoc_NoteComment::Set(aNoteLabel, theUserName, theTimeStamp, theComment);
}
-// =======================================================================
-// function : CreateBalloon
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_Note) XCAFDoc_NotesTool::CreateBalloon(
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
return XCAFDoc_NoteBalloon::Set(aNoteLabel, theUserName, theTimeStamp, theComment);
}
-// =======================================================================
-// function : CreateBinData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_Note) XCAFDoc_NotesTool::CreateBinData(
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
theFile);
}
-// =======================================================================
-// function : CreateBinData
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_Note) XCAFDoc_NotesTool::CreateBinData(
const TCollection_ExtendedString& theUserName,
const TCollection_ExtendedString& theTimeStamp,
theData);
}
-// =======================================================================
-// function : GetNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::GetNotes(const XCAFDoc_AssemblyItemId& theItemId,
TDF_LabelSequence& theNoteLabels) const
{
return theNoteLabels.Length();
}
-// =======================================================================
-// function : GetNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::GetNotes(const TDF_Label& theItemLabel,
TDF_LabelSequence& theNoteLabels) const
{
return GetNotes(labeledItem(theItemLabel), theNoteLabels);
}
-// =======================================================================
-// function : GetAttrNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::GetAttrNotes(const XCAFDoc_AssemblyItemId& theItemId,
const Standard_GUID& theGUID,
TDF_LabelSequence& theNoteLabels) const
return theNoteLabels.Length();
}
-// =======================================================================
-// function : GetAttrNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::GetAttrNotes(const TDF_Label& theItemLabel,
const Standard_GUID& theGUID,
TDF_LabelSequence& theNoteLabels) const
return GetAttrNotes(labeledItem(theItemLabel), theGUID, theNoteLabels);
}
-// =======================================================================
-// function : GetSubshapeNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::GetSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId,
Standard_Integer theSubshapeIndex,
TDF_LabelSequence& theNoteLabels) const
return theNoteLabels.Length();
}
-// =======================================================================
-// function : AddNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_NotesTool::AddNote(const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId)
{
return anItemRef;
}
-// =======================================================================
-// function : AddNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_NotesTool::AddNote(const TDF_Label& theNoteLabel,
const TDF_Label& theItemLabel)
{
return AddNote(theNoteLabel, labeledItem(theItemLabel));
}
-// =======================================================================
-// function : AddNoteToAttr
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_NotesTool::AddNoteToAttr(
const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId,
return anItemRef;
}
-// =======================================================================
-// function : AddNoteToAttr
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_NotesTool::AddNoteToAttr(const TDF_Label& theNoteLabel,
const TDF_Label& theItemLabel,
const Standard_GUID& theGUID)
return AddNoteToAttr(theNoteLabel, labeledItem(theItemLabel), theGUID);
}
-// =======================================================================
-// function : AddNoteToSubshape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_NotesTool::AddNoteToSubshape(
const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId,
return anItemRef;
}
-// =======================================================================
-// function : AddNoteToSubshape
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Handle(XCAFDoc_AssemblyItemRef) XCAFDoc_NotesTool::AddNoteToSubshape(
const TDF_Label& theNoteLabel,
const TDF_Label& theItemLabel,
return AddNoteToSubshape(theNoteLabel, labeledItem(theItemLabel), theSubshapeIndex);
}
-// =======================================================================
-// function : RemoveNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveNote(const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId,
Standard_Boolean theDelIfOrphan)
return Standard_True;
}
-// =======================================================================
-// function : RemoveNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveNote(const TDF_Label& theNoteLabel,
const TDF_Label& theItemLabel,
Standard_Boolean theDelIfOrphan)
return RemoveNote(theNoteLabel, labeledItem(theItemLabel), theDelIfOrphan);
}
-// =======================================================================
-// function : RemoveSubshapeNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveSubshapeNote(const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId,
Standard_Integer theSubshapeIndex,
return Standard_True;
}
-// =======================================================================
-// function : RemoveSubshapeNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveSubshapeNote(const TDF_Label& theNoteLabel,
const TDF_Label& theItemLabel,
Standard_Integer theSubshapeIndex,
theDelIfOrphan);
}
-// =======================================================================
-// function : RemoveAttrNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveAttrNote(const TDF_Label& theNoteLabel,
const XCAFDoc_AssemblyItemId& theItemId,
const Standard_GUID& theGUID,
return Standard_True;
}
-// =======================================================================
-// function : RemoveAttrNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveAttrNote(const TDF_Label& theNoteLabel,
const TDF_Label& theItemLabel,
const Standard_GUID& theGUID,
return RemoveAttrNote(theNoteLabel, labeledItem(theItemLabel), theGUID, theDelIfOrphan);
}
-// =======================================================================
-// function : RemoveAllNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveAllNotes(const XCAFDoc_AssemblyItemId& theItemId,
Standard_Boolean theDelIfOrphan)
{
return Standard_True;
}
-// =======================================================================
-// function : RemoveAllNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveAllNotes(const TDF_Label& theItemLabel,
Standard_Boolean theDelIfOrphan)
{
return RemoveAllNotes(labeledItem(theItemLabel), theDelIfOrphan);
}
-// =======================================================================
-// function : RemoveAllSubshapeNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveAllSubshapeNotes(const XCAFDoc_AssemblyItemId& theItemId,
Standard_Integer theSubshapeIndex,
Standard_Boolean theDelIfOrphan)
return Standard_True;
}
-// =======================================================================
-// function : RemoveAllAttrNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveAllAttrNotes(const XCAFDoc_AssemblyItemId& theItemId,
const Standard_GUID& theGUID,
Standard_Boolean theDelIfOrphan)
return Standard_True;
}
-// =======================================================================
-// function : RemoveAllAttrNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::RemoveAllAttrNotes(const TDF_Label& theItemLabel,
const Standard_GUID& theGUID,
Standard_Boolean theDelIfOrphan)
return RemoveAllAttrNotes(labeledItem(theItemLabel), theGUID, theDelIfOrphan);
}
-// =======================================================================
-// function : DeleteNote
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean XCAFDoc_NotesTool::DeleteNote(const TDF_Label& theNoteLabel)
{
Handle(XCAFDoc_Note) aNote = XCAFDoc_Note::Get(theNoteLabel);
return Standard_False;
}
-// =======================================================================
-// function : DeleteNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::DeleteNotes(TDF_LabelSequence& theNoteLabels)
{
Standard_Integer nbNotes = 0;
return nbNotes;
}
-// =======================================================================
-// function : DeleteAllNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::DeleteAllNotes()
{
Standard_Integer nbNotes = 0;
return nbNotes;
}
-// =======================================================================
-// function : NbOrphanNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::NbOrphanNotes() const
{
Standard_Integer nbNotes = 0;
return nbNotes;
}
-// =======================================================================
-// function : GetOrphanNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFDoc_NotesTool::GetOrphanNotes(TDF_LabelSequence& theNoteLabels) const
{
for (TDF_ChildIterator anIter(GetNotesLabel()); anIter.More(); anIter.Next())
}
}
-// =======================================================================
-// function : DeleteOrphanNotes
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Integer XCAFDoc_NotesTool::DeleteOrphanNotes()
{
Standard_Integer nbNotes = 0;
return nbNotes;
}
-// =======================================================================
-// function : ID
-// purpose :
-// =======================================================================
+//=================================================================================================
+
const Standard_GUID& XCAFDoc_NotesTool::ID() const
{
return GetID();
}
-// =======================================================================
-// function : Dump
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_OStream& XCAFDoc_NotesTool::Dump(Standard_OStream& theOS) const
{
theOS << "Notes : " << NbNotes() << "\n"
anOther->myFaceCulling = myFaceCulling;
}
-// =======================================================================
-// function : BaseColor
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Quantity_ColorRGBA XCAFDoc_VisMaterial::BaseColor() const
{
if (myPbrMat.IsDefined)
theStyle.SetColorCurv(Quantity_NOC_WHITE);
}
-// =======================================================================
-// function : SetMaterial
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFPrs_AISObject::SetMaterial(const Graphic3d_MaterialAspect& theMaterial)
{
XCAFPrs_Style aDefStyle;
}
} // namespace
-// =======================================================================
-// function : DefineChildId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TCollection_AsciiString XCAFPrs_DocumentExplorer::DefineChildId(
const TDF_Label& theLabel,
const TCollection_AsciiString& theParentId)
return !theParentId.IsEmpty() ? theParentId + "/" + anEntryId + "." : anEntryId + ".";
}
-// =======================================================================
-// function : FindLabelFromPathId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TDF_Label XCAFPrs_DocumentExplorer::FindLabelFromPathId(const Handle(TDocStd_Document)& theDocument,
const TCollection_AsciiString& theId,
TopLoc_Location& theParentLocation,
return anInstanceLabel;
}
-// =======================================================================
-// function : FindShapeFromPathId
-// purpose :
-// =======================================================================
+//=================================================================================================
+
TopoDS_Shape XCAFPrs_DocumentExplorer::FindShapeFromPathId(
const Handle(TDocStd_Document)& theDocument,
const TCollection_AsciiString& theId)
return aShape;
}
-// =======================================================================
-// function : XCAFPrs_DocumentExplorer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFPrs_DocumentExplorer::XCAFPrs_DocumentExplorer()
: myTop(-1),
myHasMore(Standard_False),
//
}
-// =======================================================================
-// function : XCAFPrs_DocumentExplorer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFPrs_DocumentExplorer::XCAFPrs_DocumentExplorer(const Handle(TDocStd_Document)& theDocument,
const XCAFPrs_DocumentExplorerFlags theFlags,
const XCAFPrs_Style& theDefStyle)
Init(theDocument, aRootLabels, theFlags, theDefStyle);
}
-// =======================================================================
-// function : XCAFPrs_DocumentExplorer
-// purpose :
-// =======================================================================
+//=================================================================================================
+
XCAFPrs_DocumentExplorer::XCAFPrs_DocumentExplorer(const Handle(TDocStd_Document)& theDocument,
const TDF_LabelSequence& theRoots,
const XCAFPrs_DocumentExplorerFlags theFlags,
Init(theDocument, theRoots, theFlags, theDefStyle);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFPrs_DocumentExplorer::Init(const Handle(TDocStd_Document)& theDocument,
const TDF_Label& theRoot,
const XCAFPrs_DocumentExplorerFlags theFlags,
Init(theDocument, aSeq, theFlags, theDefStyle);
}
-// =======================================================================
-// function : Init
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFPrs_DocumentExplorer::Init(const Handle(TDocStd_Document)& theDocument,
const TDF_LabelSequence& theRoots,
const XCAFPrs_DocumentExplorerFlags theFlags,
initRoot();
}
-// =======================================================================
-// function : initRoot
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFPrs_DocumentExplorer::initRoot()
{
for (;;)
}
}
-// =======================================================================
-// function : initCurrent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFPrs_DocumentExplorer::initCurrent(Standard_Boolean theIsAssembly)
{
myCurrent = XCAFPrs_DocumentNode();
}
}
-// =======================================================================
-// function : Next
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void XCAFPrs_DocumentExplorer::Next()
{
if (!myHasMore)
return 0;
}
-// ================================================================
-// Function : XGetAllVisMaterials
-// Purpose :
-// ================================================================
+//=================================================================================================
+
static Standard_Integer XGetAllVisMaterials(Draw_Interpretor& theDI,
Standard_Integer theNbArgs,
const char** theArgVec)
return 0;
}
-// ================================================================
-// Function : XGetVisMaterial
-// Purpose :
-// ================================================================
+//=================================================================================================
+
static Standard_Integer XGetVisMaterial(Draw_Interpretor& theDI,
Standard_Integer theNbArgs,
const char** theArgVec)
return 0;
}
-// ================================================================
-// Function : XAddVisMaterial
-// Purpose :
-// ================================================================
+//=================================================================================================
+
static Standard_Integer XAddVisMaterial(Draw_Interpretor&,
Standard_Integer theNbArgs,
const char** theArgVec)
return 0;
}
-// ================================================================
-// Function : XRemoveVisMaterial
-// Purpose :
-// ================================================================
+//=================================================================================================
+
static Standard_Integer XRemoveVisMaterial(Draw_Interpretor&,
Standard_Integer theNbArgs,
const char** theArgVec)
return 0;
}
-// ================================================================
-// Function : XSetVisMaterial
-// Purpose :
-// ================================================================
+//=================================================================================================
+
static Standard_Integer XSetVisMaterial(Draw_Interpretor&,
Standard_Integer theNbArgs,
const char** theArgVec)
IMPLEMENT_STANDARD_RTTIEXT(Xw_Window, Aspect_Window)
-// =======================================================================
-// function : Xw_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Xw_Window::Xw_Window(const Handle(Aspect_DisplayConnection)& theXDisplay,
const Standard_CString theTitle,
const Standard_Integer thePxLeft,
#endif
}
-// =======================================================================
-// function : Xw_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Xw_Window::Xw_Window(const Handle(Aspect_DisplayConnection)& theXDisplay,
const Aspect_Drawable theXWin,
const Aspect_FBConfig theFBConfig)
#endif
}
-// =======================================================================
-// function : ~Xw_Window
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Xw_Window::~Xw_Window()
{
if (myIsOwnWin && myXWindow != 0 && !myDisplay.IsNull())
}
}
-// =======================================================================
-// function : IsMapped
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Boolean Xw_Window::IsMapped() const
{
if (myXWindow == 0)
#endif
}
-// =======================================================================
-// function : Map
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Xw_Window::Map() const
{
if (IsVirtual() || myXWindow == 0)
#endif
}
-// =======================================================================
-// function : Unmap
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Xw_Window::Unmap() const
{
if (IsVirtual() || myXWindow == 0)
#endif
}
-// =======================================================================
-// function : DoResize
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_TypeOfResize Xw_Window::DoResize()
{
if (IsVirtual() || myXWindow == 0)
#endif
}
-// =======================================================================
-// function : Ratio
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Standard_Real Xw_Window::Ratio() const
{
if (IsVirtual() || myXWindow == 0)
#endif
}
-// =======================================================================
-// function : Position
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Xw_Window::Position(Standard_Integer& theX1,
Standard_Integer& theY1,
Standard_Integer& theX2,
#endif
}
-// =======================================================================
-// function : Size
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Xw_Window::Size(Standard_Integer& theWidth, Standard_Integer& theHeight) const
{
if (IsVirtual() || myXWindow == 0)
#endif
}
-// =======================================================================
-// function : SetTitle
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Xw_Window::SetTitle(const TCollection_AsciiString& theTitle)
{
if (myXWindow != 0)
}
}
-// =======================================================================
-// function : InvalidateContent
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void Xw_Window::InvalidateContent(const Handle(Aspect_DisplayConnection)& theDisp)
{
if (myXWindow == 0)
#endif
}
-// =======================================================================
-// function : VirtualKeyFromNative
-// purpose :
-// =======================================================================
+//=================================================================================================
+
Aspect_VKey Xw_Window::VirtualKeyFromNative(unsigned long theKey)
{
#if defined(HAVE_XLIB)
return Aspect_VKey_UNKNOWN;
}
-// =======================================================================
-// function : ProcessMessage
-// purpose :
-// =======================================================================
+//=================================================================================================
+
bool Xw_Window::ProcessMessage(Aspect_WindowInputListener& theListener,
XEvent&
#if defined(HAVE_XLIB) // msvc before VS2015 had problems with (void )theMsg
#include <Standard_OutOfRange.hxx>
#include <Standard_Dump.hxx>
-// =======================================================================
-// function : gp_Mat
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Mat::gp_Mat(const gp_XYZ& theCol1, const gp_XYZ& theCol2, const gp_XYZ& theCol3)
{
myMat[0][0] = theCol1.X();
myMat[2][2] = theCol3.Z();
}
-// =======================================================================
-// function : SetCol
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::SetCol(const Standard_Integer theCol, const gp_XYZ& theValue)
{
Standard_OutOfRange_Raise_if(theCol < 1 || theCol > 3, " ");
}
}
-// =======================================================================
-// function : SetCols
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::SetCols(const gp_XYZ& theCol1, const gp_XYZ& theCol2, const gp_XYZ& theCol3)
{
myMat[0][0] = theCol1.X();
myMat[2][2] = theCol3.Z();
}
-// =======================================================================
-// function : SetCross
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::SetCross(const gp_XYZ& theRef)
{
const Standard_Real X = theRef.X();
myMat[2][1] = X;
}
-// =======================================================================
-// function : SetDot
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::SetDot(const gp_XYZ& theRef)
{
const Standard_Real X = theRef.X();
myMat[2][1] = myMat[1][2];
}
-// =======================================================================
-// function : SetRotation
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::SetRotation(const gp_XYZ& theAxis, const Standard_Real theAng)
{
// Rot = I + sin(Ang) * M + (1. - cos(Ang)) * M*M
Add(aTemp);
}
-// =======================================================================
-// function : SetRow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::SetRow(const Standard_Integer theRow, const gp_XYZ& theValue)
{
Standard_OutOfRange_Raise_if(theRow < 1 || theRow > 3, " ");
}
}
-// =======================================================================
-// function : SetRows
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::SetRows(const gp_XYZ& theRow1, const gp_XYZ& theRow2, const gp_XYZ& theRow3)
{
myMat[0][0] = theRow1.X();
myMat[2][2] = theRow3.Z();
}
-// =======================================================================
-// function : Column
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_XYZ gp_Mat::Column(const Standard_Integer theCol) const
{
Standard_OutOfRange_Raise_if(theCol < 1 || theCol > 3, "gp_Mat::Column() - wrong index");
return gp_XYZ(myMat[0][2], myMat[1][2], myMat[2][2]);
}
-// =======================================================================
-// function : Diagonal
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_XYZ gp_Mat::Diagonal() const
{
return gp_XYZ(myMat[0][0], myMat[1][1], myMat[2][2]);
}
-// =======================================================================
-// function : Row
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_XYZ gp_Mat::Row(const Standard_Integer theRow) const
{
Standard_OutOfRange_Raise_if(theRow < 1 || theRow > 3, "gp_Mat::Row() - wrong index");
return gp_XYZ(myMat[2][0], myMat[2][1], myMat[2][2]);
}
-// =======================================================================
-// function : Invert
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::Invert()
{
Standard_Real aNewMat[3][3];
Multiply(aDet);
}
-// =======================================================================
-// function : Inverted
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Mat gp_Mat::Inverted() const
{
gp_Mat aNewMat;
return aNewMat;
}
-// =======================================================================
-// function : Power
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::Power(const Standard_Integer theN)
{
if (theN == 1)
}
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_VECTOR_CLASS(theOStream,
#include <Standard_ConstructionError.hxx>
#include <Standard_OutOfRange.hxx>
-// =======================================================================
-// function : gp_Mat2d
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_Mat2d::gp_Mat2d(const gp_XY& theCol1, const gp_XY& theCol2)
{
myMat[0][0] = theCol1.X();
myMat[1][1] = theCol2.Y();
}
-// =======================================================================
-// function : SetCol
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat2d::SetCol(const Standard_Integer theCol, const gp_XY& theValue)
{
Standard_OutOfRange_Raise_if(theCol < 1 || theCol > 2, "gp_Mat2d::SetCol() - invalid index");
}
}
-// =======================================================================
-// function : SetCols
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat2d::SetCols(const gp_XY& theCol1, const gp_XY& theCol2)
{
myMat[0][0] = theCol1.X();
myMat[1][1] = theCol2.Y();
}
-// =======================================================================
-// function : SetRow
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat2d::SetRow(const Standard_Integer theRow, const gp_XY& theValue)
{
Standard_OutOfRange_Raise_if(theRow < 1 || theRow > 2, "gp_Mat2d::SetRow() - invalid index");
}
}
-// =======================================================================
-// function : SetRows
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat2d::SetRows(const gp_XY& theRow1, const gp_XY& theRow2)
{
myMat[0][0] = theRow1.X();
myMat[1][1] = theRow2.Y();
}
-// =======================================================================
-// function : Column
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_XY gp_Mat2d::Column(const Standard_Integer theCol) const
{
Standard_OutOfRange_Raise_if(theCol < 1 || theCol > 2, "gp_Mat2d::Column() - invalid index");
return gp_XY(myMat[0][1], myMat[1][1]);
}
-// =======================================================================
-// function : Diagonal
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_XY gp_Mat2d::Diagonal() const
{
return gp_XY(myMat[0][0], myMat[1][1]);
}
-// =======================================================================
-// function : Row
-// purpose :
-// =======================================================================
+//=================================================================================================
+
gp_XY gp_Mat2d::Row(const Standard_Integer theRow) const
{
Standard_OutOfRange_Raise_if(theRow < 1 || theRow > 2, "gp_Mat2d::Row() - invalid index");
return gp_XY(myMat[1][0], myMat[1][1]);
}
-// =======================================================================
-// function : Invert
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat2d::Invert()
{
Standard_Real aNewMat[2][2];
myMat[1][1] = aNewMat[1][1] * aDet;
}
-// =======================================================================
-// function : Power
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Mat2d::Power(const Standard_Integer theN)
{
if (theN == 1)
return Vres;
}
-// =======================================================================
-// function : DumpJson
-// purpose :
-// =======================================================================
+//=================================================================================================
+
void gp_Vec::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
{
OCCT_DUMP_VECTOR_CLASS(theOStream, "gp_Vec", 3, coord.X(), coord.Y(), coord.Z())