Plotting two-dimensional rectangles in OCC

Source: Internet
Author: User

Draw a two-level rectangle on the screen

#include <Visual3d_Layer.hxx>

#include <V3d_LayerMgr.hxx>

#include <Visual3d_ViewManager.hxx>

#include "FTFont.h"

#include "FTGLBitmapFont.h"

Class V3d_textitem:public Visual3d_layeritem {public:

V3d_textitem (const Handle (visual3d_layer) & Thelayer);

void Redrawlayerprs ();

Private

Standard_real myX1;

Standard_real myY1;

Tcollection_asciistring MyText;

Standard_real Myheight;

Handle (Visual3d_layer) Mylayer;

Quantity_color MyColor;

Quantity_color Mysubtitlecolor;

Aspect_typeofdisplaytext MyType;

Tcollection_asciistring Myfontname;

};

V3d_textitem::v3d_textitem (const Handle (visual3d_layer) & Thelayer): Mylayer (Thelayer)

{

if (!mylayer.isnull ()) Mylayer->addlayeritem (this);

}

void V3d_textitem::redrawlayerprs ()

Interactive_context_->currentviewer ()->initactiveviews ();

Handle (v3d_view) V3d_view = Interactive_context_->currentviewer ()->activeview ();

Handle (visual3d_layer) Anoverlay = Interactive_context_->currentviewer ()->viewer ()->overlayer ();

if (Anoverlay.isnull ())

{

Handle (v3d_layermgr) amgr = new V3d_layermgr (V3d_view);    Anoverlay = Amgr->overlay (); V3d_view->setlayermgr (amgr);

}

Anoverlay->begin ();

Anoverlay->drawrectangle (0, 0, 100, 100);

Anoverlay->end ();

A visual3d_layer associated with a v3d, first compiled into a display list, and then rendered.

To draw a two-dimensional rectangle in OCC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.