Moving an engineering application from standalone to internal to CAD - c++

I have a large MFC C++ application that I would be very keen to port into AutoCAD and IntelliCAD. AutoDesk offer Object ARX for this purpose, which replaces the older and slower ADS technology. IntelliCAD, afaik only supports ADS. Has anyone out there done this, and if so which tools did you use and what pitfalls did you encounter?
I'm specifically interested in resources that will simplify the transition, and allow me to maintain seperate CAD based and standalone versions going forward.

Have a look at my answers to a couple of previous AutoCAD questions
Open source cad drawing (dwg) library in C#
.Net CAD component that can read/write dxf/ dwg files
If you were looking for the same code base to work both inside and outside of AutoCAD then the RealDWG approach may work for you since the code is the same - RealDWG doesn't need AutoCAD as a host application. The open Design Alliance libraries are for making stand-alone applications. Both have supported C++ for years & can be considered stable - well, as stable as CAD gets.
This blog (http://through-the-interface.typepad.com/) is a good one for RealDWG

One option to consider is to target AutoCAD and Bricscad. Supporting AutoCAD and IntelliCAD requires essentially two versions of code. Bricscad's goal is to be completely compatible with ObjectARX, and in my experience they are pretty close.
This at least simplifies the problem from supporting three instances (your standalone version, AutoCAD, and IntelliCAD) to supporting two instances (your standalone version and AutoCAD/Bricscad).

"DWGdirect is not just a SDK to read and write DWG files. It actually offers a full blown framework that can be used to develop a professional CAD application, complete with plug-in architecture and all." quote source

Related

Best practices for managing C++ app with Win32 and UWP/Xbox platform support?

I'm working on a project, specifically a game engine, that has support for both Windows Desktop (Win32) and Universal Windows (UWP/WinRT for Xbox One) platforms. Though I'm having trouble managing it. For Visual Studio, WinRT projects and standard C++ projects need to be compiled with different project types. So for each project I need to build I need to have two projects that build the same source code. For example, the engine needs to be compiled using two different projects. Once, for each platform I want to run on. Meaning everytime I need to run and test it on each platform I need to manually set the startup project to the project I want to launch. I hope that makes sense.
So my question is: Are there any tools, best practices or design patterns, for dealing with projects like this? Ideally I would like to just change the configuration to, say Xbox One, to launch for Xbox One, or Win32, to launch for Windows Desktop. But am open to new sugggestions.
Thanks!
I have a number of C++ libraries that build for "classic" Win32 desktop, Windows 10 desktop, UWP, and Xbox. The majority of the code is Win32 C++ or DirectX. For games, audio, and rendering, there's a pretty clear overlap of these platforms which is where I focused.
https://github.com/microsoft/DirectXTK/
https://github.com/microsoft/DirectXTK12/
https://github.com/microsoft/DirectXTex/
https://github.com/microsoft/DirectXMesh/
I have a blog series that captures much of the 'best practices' I used you may want to reference: Dual-use Coding Techniques for Games.
There are a few cases where I needed to interact with Windows Runtime APIs. In some contexts, I use the C++/CX extension guarded with __cplusplus_winrt. In some cases I used WRL via the low-level ABI (which is frankly pretty ugly, but I didn't need to do all that much). C++/CX is only supported by Microsoft Visual C++, so WRL or better yet C++/WinRT is a better choice for new projects.
Concrete examples would be:
GamePads - https://github.com/microsoft/DirectXTK/blob/master/Src/GamePad.cpp
Keyboard - https://github.com/microsoft/DirectXTK/blob/master/Src/Keyboard.cpp
Mouse - https://github.com/microsoft/DirectXTK/blob/master/Src/Mouse.cpp
XAudio2 device enumeration - https://github.com/microsoft/DirectXTK/blob/master/Audio/AudioEngine.cpp
All multi-platform engines isolate things like the 'window management, presentation loop, and swap chain'. For the Microsoft platforms, I've captured these in VS templates on GitHub.
Each platform also has it's own implementation of things like Cloud-based Storage, Store/licensing APIs, Multiplayer matching/connection, etc. so you'll need to isolate these as well if you implement them.
All that said, you should think about what your goals are for this project. If you want to create a game, use something that's readily available like UnrealEngine or Unity. If you want to learn more about graphics and games technology like Direct3D, audio, etc. then a small engine is a good idea but you should really scope your target platform to something simple. Writing a 'multi-platform' engine is a huge task, so just sticking to one to start is usually the better option.

Marmalade and AppEasy

I wanted to know some general throughts about Marmalade and AppEasy. http://www.appeasymobile.com/
I've been following DrMop's tutorials on creating a game engine in Marmalade but noticed that since the tutorials he's gone on to make AppEasy(with others). I have looked at it and have a couple of immediate concerns
1) How easily I can incorporate text files/xml files with XOML.
2) What degree of control I would have over the code base.
3) How deep the engine is and whether it has any comparitable rivels which are better.
I've started the project I'm working on with the IWGame engine that DrMop was using in his tutorials but was wondering that if all my fears are unfounded if it is worth carrying on?
Cheers,
Support for IwGame is coming to a close. IwGame is being replaced by the AppEasy Core SDK, which is an open source portable engine where Marmalade is just one of the platforms that it plans to support. AppEasy Core will also be open source so others can contribute to its development, submit bug fixes etc..
XOML + Lua or XOML + C++ or all 3 used together provide a very powerful easy to use environment. You can easily integrate text files, XML files, image files, sound files etc. You should check out the official web site appeasymobile, theres plenty of documentation and a drag and drop app builder that spits out cross platform apps based on XOML + Lua.
Cocos2d-x is a good alternative, but you will need to set up each dev environment for each platform you plan to support (massive pain to do) as it doesn't cross platform compile stuff for you. Although Marmalade do now have a stable interface to Cocos2dx which enables you to use Cocos2dx cross multiple platforms.

Portable C++ Component Design

I've been using COM and .NET assemblies in the past to develop component-based-systems. Now I'm going to work on a cross-plattform-C++-project and want to structure the code in components aswell…
Obviously COM and .NET are not an option, as COM is not available anywhere but Windows and Assemblies would add dependencies to the .NET framwork which may be not available at the target system.
I'm aware that due to ABI-differences I won't be able to move components between different operating systems without recompilation, but I would like to write the code in a manner, that it's compatible at source-code-level.
Is there any system/framework that enables such a architecture in C++?
I have worked with such a system in the past - we basically re-invented COM. If you are interested in that approach, check out this great article: http://msdn.microsoft.com/en-us/library/ms809983.aspx
The Mozilla suite uses a framework called XPCOM. Never used it myself, but the implication it's supposed to be like Microsoft's COM but portable. That's the only in-process component system I know of that's native code based; if you're working in Java, there's OSGi.
These days most Unix software appears to use distributed component models, where components live in different processes. The current fashionable system appears to be DBus; KDE3 used an alternative called DCOP; and of course if you want to go this route there's good old CORBA.
If you can live with a Qt dependency (only core libraries, no GUI libs), you could have a look at the CTK Plugin Framework
It is licensed under Apache 2.0 and is a dynamic C++ component system with an API which is nearly identical to OSGi.
Maybe this: http://blog.redshoelace.com/2007/09/what-is-boostextension.html

How to go about a platform independent E-Book Reader in C/C++?

I'm trying to develop an ebook reader(for mobile devices) which is platform independent. Currently my focus is epub only.
As a proof of concept, we were able to make a basic epub reader for android platform, using the functionalities provided by the platform itself(using webview, Xml Parser, Unzipper etc). But now we want to make it platform independent and we want to do it in C/C++. I know we have unzippers and xml parsers in C/C++, its the rendering part I'm worried about. My questions are...
1.How can I do the rendering, without using any of the inbuilt android views, so that it will work on other platforms also?
2.Is it better to stick to webkit for epub(the platforms which we're considering all have webkit)?
As of now I'm clueless. Any pointers on where to start?
BR,
Rajeev
Most likely you will have to split your application into the cross-platform backend and a platform specific front-end.
If you want to implement indexing and searching of all e-pubs in your app, this could be part of the cross-platform part. If the epub reader contains a catalogue of downloaded/transferred epubs, the database including its access methods could probably be cross-platform as well (at least partially).
However, the presentation layer, i.e., the user interface, will probably have to be platform-specific. The best case scenario is that you can come up with an intermediate UI description language that can be automatically translated into Android / iPhone user interfaces. That is a daunting task however, and it's probably not even worth trying if you don't want to create many cross-platform apps.
The only C/C++ development environment i found was MoSync.

What is the best approach to use openGL in the web?

I wrote a program in C++/OpenGL (using Dev-C++ compiler) for my calculus 2 class. The teacher liked the program and he requested me to somehow put it online so that instead of downloading the .exe I can just run it on the web browser. Kinda like java applets run on the browser.
The question is:
How if possible, can I display a C++/OpenGL program in a web browser?
I am thinking of moving to JOGL which is a java interpretation of OpenGL but I rather stay in C++ since I am more familiar with it.
Also is there any other better and easier 3D web base API that I can consider?
There is a lot activity recently with WebGL. It is a binding for Javascript to native OpenGL ES 2.0 implementations, designed as an extension of the canvas HTML5 element.
It is supported by the nightly builds of Firefox, Safari, Chrome and Opera.
Have a look at these tutorials, based on the well known NeHe OpenGL tutorials.
Several projects based on WebGL are emerging, most notably Scenegraphs APIs.
From Indie teams: SceneJS, GLGE, SpiderGL.
From Google: the team behind O3D plugin is trying to implement a pure WebGL backend (source) for the project, so that no plugin will be necessary.
From W3C/Web3D: There is an ongoing discussion to include X3D as part of any HTML5 DOM tree, much like SVG in HTML4. The X3DOM project was born last year to support this idea. Now it is using WebGL as its render backend, and is version 1.0 since March 2010.
I'm almost sure that WebGL is the way to go in the near future. Mozilla/Google/Apple/Opera are promoting it, and if the technology works and there is sufficient customer/developer demand, maybe Microsoft will implement it on IE (let's hope that there will be no "WebDX"!).
AFAIK, there's only 3 options:
Java. it includes the whole OpenGL stack.
Google's Native Client (NaCL), essentially it's a plugin that let's you run executable x86 code. Just compile it and call it from HTML. Highly experimental, and nobody will have it already installed. Not sure if it gives you access to OpenGL libraries.
Canvas:3D. Another very experimental project. This is an accelerated 3D API accessible from JavaScript. AFAICT, it's only on experimental builds of Firefox.
I'd go for Java, if at all.
OTOH, if it's mostly vectorial works (without lots of textures and illumination/shadows), you might make it work on SVG simply by projecting your vectors from 3D to 2D. In that case, you can achieve cross-browser compatibility using SVGWeb, it's a simple JavaScript library that allows you to transparently use either the browser's native SVG support or a Flash-based SVG renderer.
Do you really have the time to rewrite it? I thought students were meant to be too busy for non-essential assignment work.
But if you really want to do it, perhaps a preview of it running as a flash movie is the easiest way. Then it's just a matter of doing that and you could provide a download link to the real application if people are interested.
Outside of Java, in-browser OpenGL is really in its infancy. Google's launched a really cool API and plugin for it though. It's called O3D:
http://code.google.com/apis/o3d/
Article about the overall initiative:
http://www.macworld.com/article/142079/2009/08/webgl.html
It's not OpenGL, but the Web3D Consortium's X3D specification may be of interest.
Another solution is to use Emscripten (a source-to-source compiler).
Emscripten supports C/C++ and OpenGL and will translate the source into html/JavaScript.
To use Emscripten you will need to use SDL as a platform abstraction layer (for getting an OpenGL context as well as loading images).
Emscripten is currently being used in Unreal Engine and will also be used in the Unity 5 engine.
Read more about the project here:
https://github.com/kripken/emscripten
Two approaches:
Switch to Java. However, your application will suffer from a loss of performance as a trade off for portability. But since Java is everywhere, this approach ensures that your code can be executed in most browsers.
Use ActiveX, which allows you to run native binary code for Microsoft Windows. This is not recommended in production because activeX is well known as a potential security hole, but since your lecturer is the one viewing it, security doesn't seem to be a big deal. This is applicable for Microsoft platform (Windows+IE) only.