Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Intoduction

Class diagram represent API architecture, objects (classes) structure, services (methods) and their relations.

This diagram reflects:

  • resulting JSON objects structure, which will be sent to client upon AJAX request with defined services
  • class methods (services), which can be used by the client with HTTP requests (see BIM+ Services for detailed description).

Class methods here are not the real class methods, but list of HTTP methods, applicable to particular object. Thus from the scheme you can see which objects are read only and which ones can be modified / updated by the user.

Object name means that you can use it lowercased as a path (route) to resource / collection. Fields define which properties will be transferred to client as resulting JSON string. If you provide an element id in collection, particular object in the collection will be addressed and you will get its detailed information. 

Example:

Object:

 is read only, has method get(), implemented as web service. This means that by a client it can be used as follows:

Code Block
https://api.bimplus.net/v2/bimplus/disciplines/

Default HTTP method is get, so we mustn't specify it explicitly in the request. Server responses with a string, which automatically will be converted into JSON object:

Code Block
{
   "0f106af0-a919-44c5-b211-15bd5ef620b6": {
       id: "0f106af0-a919-44c5-b211-15bd5ef620b6",
       name: "<LOCALIZATION_STRING_ID>",
       category: "/1/",
       ifctype: null
   },
   {...},
   ...
}

Anchor
object_definition
object_definition

Objects, elements, node and topology definition

Topology tree consist of objects which can have or have no graphical representation:

  1. Node -- objects with no graphical representation (geometry) 
  2. Object or Element -- objects with geometry

Both types of objects have the same properties and attributes, but can have slightly different (filtered) set of them, which depends on how the object was requested from server. Object(s) / topology can be delivered with the Object service. There are following possibilities to request object(s) / topology:

  1. Project topology tree -- topology nodes, filtered till the level "subproject"
  2. Topology -- node with all its children nodes
  3. Object -- by default with all properties, attributes, geometry and children

Generally these objects have following structure:

Code Block
{
	id: "54dd1d25-4c58-4af2-96a1-1d26fa440177",
	name: "<LOCALIZATION_STRING_ID>",
	type: "<LOCALIZATION_STRING_ID>",
	disciplineId: "6a6e4d09-3550-4483-8134-98ac1e6c1afb",
        divisionId: "10074EEF-9418-4D64-9C6D-23932835A7F1"
	parent: null,
	attributes: {
		general: {
			name: "<LOCALIZATION_STRING_ID>",
			valid: true
		},
		quantity: {
			length: 8523.27,
			width: 300,
			height: 2500,
			volume: 6392448992.508584,
			area: 21308163.308361948
		},
		<...>,
		geometry: {
			<geometry_type>: {
				'colors':4291993670,
	 			'vertices':[96.149, 179.546...],
 				'faces':[4,0,1,2,3, 3,4,5,6, ...]
			}
		}
	},
	children: <child_objects>
}

where <geometry_type>:

  • "mesh"
  • "meshblob"
  • "threejs"

Below is short description of these types with JSON examples.

Anchor
geometry_formats
geometry_formats

Geometry types

Note

Note: Objects with geometry types "mesh" or "meshblob" can be written into BIM+ database. Geometry type "threejs" optimized for viewing on mobile devices or in browser and can not be written to the database directly.

Mesh type
Code Block
mesh: {
	colors: 4291993670,
	vertices: [ 96.149, 179.546, ... ],
	faces: [ 4,0,1,2,3, 3,4,5,6, ... ]
}

where:
    color:  array of decimal RGBA values;
    vertices: plain array of 3D vertices coordinates like [x0, y0, z0, x1, y1, z1, ...]
    faces: plain array of faces definitions like first number is quantity of vertices, than vertex indices list, see example.

Mesh BLOB type

This type generally compressed mesh format intended to be used in the desktop CAD applications. Internal CAD format of the geometry with help of client side C# DLL will be converted into BIM+ mesh format (described above) and compressed (z.b. with ZIP) in order to get smaller JSON size. In this case JSON objects looks like:

Code Block
meshblob: "d273f7a6a7d8f8725484fe6282..."
TreeJS type

as mentioned above this format is optimized for viewing on mobile devices or in browser. Native model will be filtered and tessellated in order to deliver minimal JSON size and maximal navigation speed (FPS). This model has ThreeJS JSON v 3.1 format and can be directly parsed by the client. JSON object in this case looks like:

Code Block
threejs: {
    <ThreeJS_JSON_format>
}

Object services and resulting object collections structures.

As described above different types of JSON object collections can be obtained, depending on which object service will be used. It doesn't alter single object structure, but resulting object collections can have slightly different structure. Since we're working with object collections, we can have a set of objects which contain topology tree without geometry, or object collections with geometry. In the case we've requested a collection of objects with geometry, we need some additional information f.e. like view box size (3D model dimensions which should be rendered). So these properties will be added to the set of objects. Thus generally we can consider objects collection like a set of objects with additional properties. Object collection type defined by additional element in the resource path.

Services getTopology() and getProjectTree()

HTTP request: (see BIM+ Services):

Code Block
GET https://api.bimplus.net/v2/bimplus/objects/<object_id>/topology

As a resulting set following JSON object should be created:

Code Block
{
	objects: {
		id: "54dd1d25-4c58-4af2-96a1-1d26fa440177",
,		type: "<LOCALIZATION_STRING_ID>",
		divisionId: "10074EEF-9418-4D64-9C6D-23932835A7F1",
		disciplineId: "6a6e4d09-3550-4483-8134-98ac1e6c1afb",
		parent: null,
		children: <child_objects>}
	},
	{...},
	...
}

For the project topology the depth of the tree will be filtered till the node type "subproject".

Alternative Geometry Services getMesh(), getThreejs()

HTTP request: (see BIM+ Services):

Code Block
GET https://api.bimplus.net/v2/bimplus/objects/<object_id>/geometries

this is default request. In case we want to obtain ThreeJS geometry type for each object, 
we should add geometry type to the request:

GET https://api.bimplus.net/v2/bimplus/objects/<object_id>/geometries/threejs

As a resulting set following JSON object should be created for getMesh():

Code Block
{
	colors: [123414, 9817413, ....],
	objects: [
		{
			id: "54dd1d25-4c58-4af2-96a1-1d26fa440177",
			name: "<LOCALIZATION_STRING_ID>",
			type: "<LOCALIZATION_STRING_ID>",
			divisionId: "10074EEF-9418-4D64-9C6D-23932835A7F1",
			disciplineId: "6a6e4d09-3550-4483-8134-98ac1e6c1afb",
			parent: null,
			attributes: {
				general: {
					name: "<LOCALIZATION_STRING_ID>",
					valid: true
				},
				quantity: {
					length: 8523.27,
					width: 300,
					height: 2500,
					volume: 6392448992.508584,
					area: 21308163.308361948
				},
				<...>,
				geometry: {
					mesh: {<mesh_type_geometry>}
				}
			},
			children: <child_objects>
		},
		{...},
		...
	],
}

JSON object for getThreejs():

Code Block
{
	elementcount: 14312,
	viewbox: {
		x: 827364,
		y: 23765,
		z: 2974652,
		with: 827346,
		height: 2873456,
		depth: 1726354
	},
	colors: [123414, 9817413, ....],
	objects: [
		{
			id: "54dd1d25-4c58-4af2-96a1-1d26fa440177",
			type: "<LOCALIZATION_STRING_ID>",
			divisionId: "10074EEF-9418-4D64-9C6D-23932835A7F1",
			disciplineId: "6a6e4d09-3550-4483-8134-98ac1e6c1afb",
			parent: null,
			attributes: {
				general: {
					name: "<PP>Wall layer",
					valid: true
				},
				quantity: {
					length: 8523.27,
					width: 300,
					height: 2500,
					volume: 6392448992.508584,
					area: 21308163.308361948
				},
				<...>,
				geometry: {
					threejs: {<threejs_type_geometry>}
				}
			},
			children: <child_objects>
		},
		{...},
		...
	],
}

Project properties JSON structure

Since project properties will be generated internally on the fly upon request, some of them (like divisions list) will be sent in the project attributes. Here is an example of the project JSON structure:

Code Block
{
	id: "54dd1d25-4c58-4af2-96a1-1d26fa440177",
	name: "Allplan Tübing",
	thumbnail: "http://bimplus.net/images/thumb123231.png",
	shortDescr: "...",
	created: "Mi  8 Mai 2013 11:48:13 CEST",
	changed: "Mi  8 Mai 2013 11:48:13 CEST",
	disciplines: [
		{
			id: "0f106af0-a919-44c5-b211-15bd5ef620b6",
			name: "<LOCALIZATION_STRING_ID>",
			divisionId : "6a6e4d09-3550-4483-8134-98ac1e6c1afb",
			divisionName: "<LOCALIZATION_STRING_ID>",
			revisions: [1, 2, 3, 4, ...]
		},
		{...},
		...
	]
}

Anchor
classDiagramFull
classDiagramFull

Class diagrams (v2, draft)

Anchor
class_diagram_full
class_diagram_full

General

Gliffy Diagram
nameobject_model
version26

Anchor
class_diagram_objects
class_diagram_objects

Objects and its Attributes (v2, draft)

Gliffy Diagram
sizeL
nameObjects and its Attributes
alignleft
version4