/**************************************************************************** ** Copyright (c) 2021, Fougue Ltd. ** All rights reserved. ** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt ****************************************************************************/ #pragma once #include "../base/occ_handle.h" #include #include #include // Note: can't include Aspect_DisplayConnection.hxx as this is causing name conflicts // with XLib in other files(with GraphicsObjectDriver::Support::None) // This seems to happen only for OpenCascade <= v7.5 class Aspect_DisplayConnection; class Aspect_Grid; class Aspect_Window; class AIS_InteractiveContext; class AIS_InteractiveObject; class Graphic3d_ClipPlane; class Image_PixMap; class V3d_View; class V3d_Viewer; class gp_Dir; namespace Mayo { struct GraphicsUtils { struct AspectGridColors { Quantity_Color base; Quantity_Color tenth; }; static void V3dView_fitAll(const OccHandle& view); static bool V3dView_hasClipPlane(const OccHandle& view, const OccHandle& plane); static gp_Pnt V3dView_to3dPosition(const OccHandle& view, double x, double y); static bool V3dViewer_isGridActive(const OccHandle& viewer); static OccHandle V3dViewer_grid(const OccHandle& viewer); static AspectGridColors V3dViewer_gridColors(const OccHandle& viewer); static void V3dViewer_setGridColors(const OccHandle& viewer, const AspectGridColors& colors); static void AisContext_eraseObject( const OccHandle& context, const OccHandle& object ); static void AisContext_setObjectVisible( const OccHandle& context, const OccHandle& object, bool on ); static AIS_InteractiveContext* AisObject_contextPtr(const OccHandle& object); static bool AisObject_isVisible(const OccHandle& object); static void AisObject_setVisible(const OccHandle& object, bool on); static Bnd_Box AisObject_boundingBox(const OccHandle& object); static int AspectWindow_width(const OccHandle& wnd); static int AspectWindow_height(const OccHandle& wnd); static OccHandle AspectDisplayConnection_create(); static void Gfx3dClipPlane_setCappingHatch( const OccHandle& plane, Aspect_HatchStyle hatch ); static void Gfx3dClipPlane_setNormal( const OccHandle& plane, const gp_Dir& n ); static void Gfx3dClipPlane_setPosition( const OccHandle& plane, double pos ); static bool ImagePixmap_flipY(Image_PixMap& pixmap); }; } // namespace Mayo