CAD-interface: 2D-scroll + zoom

peacemaker

Expert
Licensed User
Longtime User
Hi, All

The more i try to make the crossplatform code for CAD-interfaced vector object editor - the more i think it's impossible cross-platformely.
Who used any CAD-software where
1) there is the working sheet where placed the objects, draggable objects + 2D scrollable area - it's like IDE-interface of any VisualDesigner, but
2) but also there is the zoom: Ctrl+MouseWheel = zooming big area (sheet) in\out
?
And all these works together, smoothly.

Has anyone seen such CAD-interface under Android ? Is it possible in whole ?
Maybe it's stupid idea to make it crossplatformely ?
 
Last edited:

ilan

Expert
Licensed User
Longtime User
just an idea. what have all platform together?
they all have a webview and using a webview has many advantages specially the zooming function.

maybe run threeJS on a webview inside your app (b4j,b4a,b4i) could do the job

 

peacemaker

Expert
Licensed User
Longtime User
Ohhh, holy sh... indeed vector, zoomed, and even not 2D, but three.
And works at any platform (at last 2 tested).
So, it's possible, proved.
 

peacemaker

Expert
Licensed User
Longtime User
I'm trying to make the public lib for B4X, by B4X language... And know nothing about JS...
 

ilan

Expert
Licensed User
Longtime User
JS is really simple and very powerful. i use it a lot in my b4x apps.
otherwise i dont know how you could do a crossplatform cad lib.
 

peacemaker

Expert
Licensed User
Longtime User
i have seen such an app here in b4x already by @hookshy
Interesting app. But it is 2D drawing app using just primitive shapes. But it's really "vector" one, as each figure exists as an editable\draggable\selectable object.
But the zoom of work area is unclear, it's promised in the paid "premium pack".

And i am trying from the scratch to develop the "engine", template classes to build complex components from custom code classes, where B4X views are used, and all the parameters can be programmed by B4X code.

Now i have prepared 3 classes: pin and rectangle, and first version of the component that is a chip (box), functional block of the rectangular body + several pins that can be connected one to another (later). When all is prepared - any other classes can be created, by cloning these and update.

But anyway the editor is needed, that allows to manipulate by the objects, add, select, click, edit names, zoom in\out.... And open source code for B4X.

And i guessed, that all these is _already_ possible crossplatformly in B4X, but now i'm not sure.
It seems, platforms difference is too big to build easily.
And maybe better to develop only within B4J for big low-density screens, for desktop CAD computers.
 
Last edited:

kimstudio

Active Member
Licensed User
Longtime User
In B4A multi touch gestures like pinch-zoom in/out can be used for control-mousewheel?
 

peacemaker

Expert
Licensed User
Longtime User
In B4A multi touch gestures like pinch-zoom in/out can be used for control-mousewheel?
Maybe yes, but here it needs all together: zoom, scroll the working area and as always - clickable\draggable objects, not raster icons.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

peacemaker

Expert
Licensed User
Longtime User
should do it all with a canvas that draws the visible area each time. Not with views. And not with a huge canvas
But my solution already shows that by B4XViews - it's possible, each element can be clickable, selectable... If to see only one-screen panel - the concept is fully working.
Next is to make the editor for this huge panel containing other panels-objects... It's fully "vector" as i can understand, just structures\objects in memory, without raster blobs.
 

peacemaker

Expert
Licensed User
Longtime User
If editor is ready - next could be updating the classes codes for auto-adjusting the object dimensions according to
  • names length
  • internal objects: each object can contain other objects, recursively
And if to auto-generate such diagram-drawing - it needs to enlarge each object and its children, so the editor container must be big and zoomable for sure.
 

peacemaker

Expert
Licensed User
Longtime User
reuse all of the code I posted in the forum
Thanks ! As usual, the question is to find the needed piece of code for sure fit for the task :)
 

ilan

Expert
Licensed User
Longtime User
You can use any library you find on the forum. Unless said otherwise the license is: Creative Commons — Attribution 3.0 Unported — CC BY 3.0

Modifying the source code inside b4xlibs is not allowed unless the developer explicitly says that it is allowed.
ok sorry i misunderstood your answer above. i thought you meant that you allow @peacemaker to reuse all libraries you posted but it does not mean that all developers are also allowed to do so. but now i understood that you where talking about libs from other developers :)

my brain is like a Pentium I, it needs time to process
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
it is possible to implement cross platform zooming and panning
It's interesting that the behaviour is the same as before with a scrollview !
Trouble is at my project - not a single object like in the cross-platform ZoomImageView.

It's some conflict when together zooming\panning container's handler + drag events of several objects inside the container.
Without any try to scroll\panning - all is OK, and i guess, only zooming should be arranged...

i will create the constant project topic, to publish results there.
 
Last edited:
Top