Using Anycad three-dimensional controls in an MFC program

Source: Internet
Author: User

Anycad three-dimensional controls have a. NET version and two versions of C + +, using C + + is a little more complicated than C #. The SDK provides an encapsulation of the document view for MFC, with just a few base classes to change.

Get ready
    • VS2010

    • Download the C + + version of the ANYCAD graphics control: Http://pan.baidu.com/s/1c06hmPa

Project Settings

$ (ANYCADSDK) is replaced with the location of your project relative to the Anycad C + + SDK, or you can add ANYCADSDK to the environment variable.

    • Header file

$ (ANYCADSDK) \inc

    • Lib Find directory

$ (ANYCADSDK) \lib\$ (Configuration) \

    • Dependent Lib

AnyPlatformAPI.lib; AnyPlatformMFC.lib

    • Included in the StdAfx.h

#include "View/anysdk.h"

MFC related base class modification
    • Cwinapp/cwinappex

Replace the above class with auwinapp<cwinapp> or AUWINAPP<CWINAPPEX>, including CPP files.

    • CMainFrame: For multi-Document application CMainFrame the base class is changed to aumainframe<cmdiframewnd>; for single document application base class to Aumainframe<cframewnd>

    • CView: Replace the class that requires three-dimensional display with auview3d, including the CPP file.

The display engine-related objects can be obtained by accessing the M_VIEW3D members of the auview3d.

Use the Ribbon-style interface

Show first Model void CSampleView::OnButtonSphere() {      using namespace AnyCAD::API;      auto sphere = BrepTools().MakeSphere(Vector3(0,0,0),100);      ShowGeometry(sphere, 101, 1); }

So far so easy!

Note: The sample code above is included in the sample project that accompanies the SDK.


Using Anycad three-dimensional controls in an MFC program

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.