Civil Engineering Association

Full Version: Programming with C++ Free discussion
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Firstly many thanks Livium for your support in this discussion ...

I have developed small application with WPF ...

it is very nice ...and very easy ...but some times you have difficlties to write wpf code and c sharpe code in together ...
sometimez very slow performance ..but for small application i see no problem ...

but currently i try to write a mathematical equations ...to be appeared as wirtten in codes ... but i see it is very difficult .. i searched in net ...but no way ...
some suggested to use mathcad or matlab ..but i want to build the application either by c sharpe or wpf ...

I hope you can assist for this issue Livium ...

My best regards to all my beloved friends in the forum ...
and waiting for further discussions ...
If you wait for LiviuM take a look in Forum Team list. His last visit in forum was in 29.11.17 so...
Hi BennyP...
it is a free discussion and all can share the openions and suggestation ...
And I hope to find an assist to know how to build applications that can write a math formules ....

I see many softwares as Tedds , Midas Design+ Masterseries ... writting their own formule same as math shape ... but I could not know how to do ...
they using a graphic object to draw the formula ...or they build a library to build these special math symbols ...
I do not know ...
I try with WPF ...but could not find any solution ...

I read Charliz Petzold ... win API programming ... he discussed only special letters like greek ...Char...
I hope all can share and discuss this subject ...
Of course you can and every one who can help you is wellcomed. I only told you LiviuM is not here for a long time. I will not accept free discussion about football or girls but programning for sure.
I expect there are two solution to write Math Formula ...

Solution one to build your own graphich objects that draw the required formula ... but you will scratch from zero ...

solution two
to use any Math Library that can assist and give the required shapes ... it will become something like directx or openGL...

I see some talking for MathLB Library .. but i could not find proper instructions to implement in the project and get proper results either with C# or WPF...
I have done very little with WPF so probably not much help, but have you tried some of the open source libraries like the one below? Maybe it's not a complete solution for you but you may be able to leverage some of the existing code base to make your life easier and at least see how they implemented such functionality.

Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************
Dear mecheil.edwar,

I've never used such component, if you find one that works please share.

Some long time ago I wrote code in VB6 to parse equations. I was using a tree structure based on math operations priority. It might be a long path to create your own component, but at least it can also solve not just display.

Google using keywords: latex c# wpf
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

It also depends if the equations are static or if the user can change them and how much.

Regarding the static nature of WPF objects, for high performance dynamic graphics a "native window" DirectX component is used. Etabs and Sap are using SharpDX. Tekla was using OpenGL (don't know what's using in the current version).
I've used SharpGL for OpenGL in windows forms and I believe wpf too.

WPF was created to create a weak bind between interface and processing, and to be used by a team of programmers, so the learning curve is difficult.


About the thread subject, programming with C++

Recently I wrote some code in C with few elements of C++, for an embedded project, linux on arm processor, and the choice was C for stability and performance.
Performance:
- software had to be as real-time as possible
- each function had to run each time in a measurable time period (not shorter, not longer)
- didn't want any dependencies on external libraries, only the OS functions
- I wrote several custom protocols over UDP and TCP/IP, for performance I required some fast memory operations and casting without memcopy from byte array to struct and struct to byte array
- full control of memory allocation/release
- and I2C, SPI and UART TTL interface communication and protocols

It works, 24/7, 8 months uptime, performing the same operations each millisecond.

For the x64 part of the project, running on intel atom industrial pc, I've used .NET Core on linux and it's very stable. Console application no graphics running as service. Multithreading, 8TB custom database format and engine from scratch, data stored in 3d (zoom, x, y like google maps), custom https server and websocket server from scratch, 3 protocols over TCP and 2 over UDP. About 4 months work in c#. In c/c++ I can write that code in 2-3 years.

All code is in classes stored in .NetStandard libraries so it runs on windows .Net Framework or Linux .NetCore.
For the end user on windows I've used Windows Forms and SharpGL because I had little time.

I don't like python, and I don't like to use libraries and be stuck in other people bugs or updates or dependencies.

For a web platform I've used free and paid chart components like amcharts, smoothie chart and chart.js.
Elastic has a platform which does a lot more than I wrote, but it fails in both performance and stability compared to my custom tailored solution.
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

Best wishes
Many Thanks Livium for your valuable post ...
Kindly can you tell me some simple notes to write math formulas in VB

and any simple refernce to learn sharpGL and implement in my projects ...

I appolgize you explain so many topics for very advancd level programmers ... But I am trying to learn ...
In VB6 my goal was to solve equations like this one:
x=1
y=2
z=(x^2+y^2+3+7/2*2)^0.5/(x+y)
find z.
A tree was built on the order of operations like here:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************
The goal was to allow basic scripting e.g. analysis model template, optimization by brute-force :), adaptive modeling. Given a template the user could set some dependencies and constants and equations so the model was defined by an equation system.
e.g.
x=-50..50
y=-50..50
z=x^2+y^2+5

Like Tekla Structures scripting and parameter modeling in Custom Component editor or like Ansys Workbench.
Now there's a lot of software that allows parametric modeling. The target now is to reliably link all the packages.
So it depends on your requirements, just look at equations or solve them or...

For SharpGL, go to:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

Download the source, has some samples, most are classic opengl (or immediate mode), but it has an interesting SceneGraph.
To keep an order of all stuff, a scene is useful, it is a structure of objects, a tree, the root is the black window, objects can be added, modified, enabled/disabled, attach effects to them...

It depends what you require, e.g. if you render more than 100000 lines or points or triangles /frame, 30 fps, modern OpenGL is required. VBO, VBA and shaders.

Most links I had for tutorials are dead now, something like this:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

It works like this:
Create static buffers to store the data: vertex positions, colors, normals
Push the data in those buffers.

Draw and redraw lines/points/triangles using the buffers.
Deform, translate, rotate the objects using shader code.

If the objects are not static, and the shape equation can't be written in shader, push the data to the buffers each time required.

Buffers means that the data is transfered once from CPU RAM to GPU VRAM (requires bandwidth and cpu time).

How many buffers: one for the whole scene or multiple for different objects, some adaptive algorithm is required based on GPU specifications, max buffers count, max buffer length.

And I know you like it from c++, in modern opengl manual memory management is required for the GPU VRAM using these buffers (destroy, create...)

So what scene do you have in mind? You could prototype it using some higher level library.
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************
Many Thanks Livium for your post...
Now , in brief , what can I understand from your post that ..for math equations we need to build mathematical shapes as graphic objects , as example square root will be a on a graphic objects that draw the shape of sqr root and so and so ...

It is little bit difficult way ...

even I read to very good books for WPF the Name is " WPF in Action with vs 2008" , but also in this book the author ignored this point

I hope we can find a simple way to write math equations to be suitable for easy programming and beginner programmers

And also we are awaiting Livium for your effective support and assist ,and your valuable posts
Pages: 1 2 3 4