Exemplo n.º 1
0
    def DisplayMessage(self,point,text_to_write, message_color=None, update=False):
        """
        :point: a gp_Pnt instance
        :text_to_write: a string
        :message_color: triple with the range 0-1
        """
        aPresentation = Prs3d.Prs3d_Presentation(self._struc_mgr)
        text_aspect = Prs3d.Prs3d_TextAspect()

        if message_color is not None:
            text_aspect.SetColor(color(*message_color))

        text = Prs3d.Prs3d_Text()
        text.Draw(aPresentation.GetHandle(),
                     text_aspect.GetHandle(),
                          to_string(text_to_write),
                               point)
        aPresentation.Display()
        # TODO: it would be more coherent if a AIS_InteractiveObject would be returned
        if update:
            self.Repaint()
        return aPresentation
Exemplo n.º 2
0
    def DisplayMessage(self,
                       point,
                       text_to_write,
                       message_color=None,
                       update=False):
        """
        :point: a gp_Pnt instance
        :text_to_write: a string
        :message_color: triple with the range 0-1
        """
        aPresentation = Prs3d.Prs3d_Presentation(self._struc_mgr)
        text_aspect = Prs3d.Prs3d_TextAspect()

        if message_color is not None:
            text_aspect.SetColor(color(*message_color))

        text = Prs3d.Prs3d_Text()
        text.Draw(aPresentation.GetHandle(), text_aspect.GetHandle(),
                  to_string(text_to_write), point)
        aPresentation.Display()
        # TODO: it would be more coherent if a AIS_InteractiveObject would be returned
        if update:
            self.Repaint()
        return aPresentation
Exemplo n.º 3
0
##the Free Software Foundation, either version 3 of the License, or
##(at your option) any later version.
##
##pythonOCC is distributed in the hope that it will be useful,
##but WITHOUT ANY WARRANTY; without even the implied warranty of
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##GNU Lesser General Public License for more details.
##
##You should have received a copy of the GNU Lesser General Public License
##along with pythonOCC.  If not, see <http://www.gnu.org/licenses/>.

from OCC.gp import *
from OCC.AIS import *
from OCC.TCollection import TCollection_ExtendedString
from OCC.Utils.Construct import make_edge
from OCC.Utils.Common import to_string

from OCC.Display.SimpleGui import *
display, start_display, add_menu, add_function_to_menu = init_display()

c = gp_Circ(gp_Ax2(gp_Pnt(200.,200.,0.),gp_Dir(0.,0.,1.)), 80)
ec = make_edge(c)
ais_shp = AIS_Shape(ec)
display.Context.Display(ais_shp.GetHandle())
rd = AIS_RadiusDimension(ec,80,to_string("radius"))
rd.SetArrowSize(12)
display.Context.Display(rd.GetHandle())
display.FitAll()
start_display()
 
Exemplo n.º 4
0
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(at your option) any later version.
##
##pythonOCC is distributed in the hope that it will be useful,
##but WITHOUT ANY WARRANTY; without even the implied warranty of
##MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##GNU Lesser General Public License for more details.
##
##You should have received a copy of the GNU Lesser General Public License
##along with pythonOCC.  If not, see <http://www.gnu.org/licenses/>.

from OCC.gp import *
from OCC.AIS import *
from OCC.Utils.Construct import make_edge
from OCC.Utils.Common import to_string

from OCC.Display.SimpleGui import *
display, start_display, add_menu, add_function_to_menu = init_display()

c = gp_Circ(gp_Ax2(gp_Pnt(200., 200., 0.), gp_Dir(0., 0., 1.)), 80)
ec = make_edge(c)
ais_shp = AIS_Shape(ec)
display.Context.Display(ais_shp.GetHandle())
rd = AIS_RadiusDimension(ec, 80, to_string("radius"))
rd.SetArrowSize(12)
display.Context.Display(rd.GetHandle())
display.FitAll()
start_display()