-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup: proper server plugin project structure, corrected markdown, …
…removed obsolete patch (changes made it into Bimserver trunk)
- Loading branch information
Showing
9 changed files
with
148 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
This project started at openBIMweek 2011. | ||
Now maintained by the community. | ||
|
||
ThreeJs viewer consists of a server side part (serializer plugin) and a clientside part (ThreeJs based javascript scenegraph). | ||
|
||
In order to add the plugin to your BimServer instance, just grab the plugin jar file from downloads and drop it into the BimServer plugin folder. | ||
|
||
If you want to develop the serializer, do the following: | ||
|
||
1. checkout the BimServer source code and setup your IDE for BimServer development, e.g. for Eclipse as [explained here](http://code.google.com/p/bimserver/wiki/Eclipse) | ||
2. create a new project (Eclipse) or module (other IDEs) and checkout the ServerPlugin | ||
3. Add the following line to org.bimserver.LocalDePluginLoader.java: | ||
pluginManager.loadPluginsFromEclipseProject(new File("../JsonModelFormat2Serializer")); | ||
|
||
The plugin will now be visible in the bimserver webinterface and you can download files on "ThreeJs" json format to show in the ThreeJs client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PluginDescriptor> | ||
<PluginImplementation> | ||
<interfaceClass>org.bimserver.plugins.serializers.SerializerPlugin</interfaceClass> | ||
<implementationClass>org.bimserver.serializers.json.JSONModelFormat2SerializerPlugin</implementationClass> | ||
</PluginImplementation> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PluginDescriptor> | ||
<PluginImplementation> | ||
<interfaceClass>org.bimserver.plugins.serializers.SerializerPlugin</interfaceClass> | ||
<implementationClass>org.bimserver.serializers.json.JSONModelFormat2SerializerPlugin</implementationClass> | ||
</PluginImplementation> | ||
</PluginDescriptor> |
This file was deleted.
Oops, something went wrong.
62 changes: 31 additions & 31 deletions
62
ServerPlugin/data/BinaryIndexBuffer.java → ...r/serializers/json/BinaryIndexBuffer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
package org.bimserver.serializers.json.data; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.bimserver.utils.LittleEndianBinUtils; | ||
|
||
public class BinaryIndexBuffer { | ||
|
||
private final List<Integer> indices = new ArrayList<Integer>(); | ||
|
||
public void addIndex(int index) { | ||
indices.add(index); | ||
} | ||
|
||
public int getNrIndices() { | ||
return indices.size(); | ||
} | ||
|
||
public List<Integer> getIndices() { | ||
return indices; | ||
} | ||
|
||
public void serialize(OutputStream outputStream) throws IOException { | ||
outputStream.write(LittleEndianBinUtils.intToByteArray(indices.size())); | ||
for (Integer index : indices) { | ||
outputStream.write(LittleEndianBinUtils.intToByteArray(index)); | ||
} | ||
} | ||
package org.bimserver.serializers.json; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.bimserver.utils.LittleEndianBinUtils; | ||
|
||
public class BinaryIndexBuffer { | ||
|
||
private final List<Integer> indices = new ArrayList<Integer>(); | ||
|
||
public void addIndex(int index) { | ||
indices.add(index); | ||
} | ||
|
||
public int getNrIndices() { | ||
return indices.size(); | ||
} | ||
|
||
public List<Integer> getIndices() { | ||
return indices; | ||
} | ||
|
||
public void serialize(OutputStream outputStream) throws IOException { | ||
outputStream.write(LittleEndianBinUtils.intToByteArray(indices.size())); | ||
for (Integer index : indices) { | ||
outputStream.write(LittleEndianBinUtils.intToByteArray(index)); | ||
} | ||
} | ||
} |
82 changes: 41 additions & 41 deletions
82
ServerPlugin/data/BinaryVertexBuffer.java → .../serializers/json/BinaryVertexBuffer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
package org.bimserver.serializers.json.data; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.bimserver.utils.LittleEndianBinUtils; | ||
|
||
public class BinaryVertexBuffer { | ||
|
||
private final List<Float> vertices = new ArrayList<Float>(); | ||
private final List<Float> normals = new ArrayList<Float>(); | ||
|
||
public void addVertex(float vertex) { | ||
getVertices().add(vertex); | ||
} | ||
|
||
public int getNrVertices() { | ||
return getVertices().size(); | ||
} | ||
|
||
public void serialize(OutputStream outputStream) throws IOException { | ||
outputStream.write(LittleEndianBinUtils.intToByteArray(getVertices().size()/6)); | ||
for (Float vertex : getVertices()) { | ||
outputStream.write(LittleEndianBinUtils.floatToByteArray(vertex)); | ||
} | ||
} | ||
|
||
public List<Float> getVertices() { | ||
return vertices; | ||
} | ||
|
||
public void addNormal(float normal) { | ||
normals.add(normal); | ||
} | ||
|
||
public List<Float> getNormals() { | ||
return normals; | ||
} | ||
} | ||
package org.bimserver.serializers.json; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.bimserver.utils.LittleEndianBinUtils; | ||
|
||
public class BinaryVertexBuffer { | ||
|
||
private final List<Float> vertices = new ArrayList<Float>(); | ||
private final List<Float> normals = new ArrayList<Float>(); | ||
|
||
public void addVertex(float vertex) { | ||
getVertices().add(vertex); | ||
} | ||
|
||
public int getNrVertices() { | ||
return getVertices().size(); | ||
} | ||
|
||
public void serialize(OutputStream outputStream) throws IOException { | ||
outputStream.write(LittleEndianBinUtils.intToByteArray(getVertices().size()/6)); | ||
for (Float vertex : getVertices()) { | ||
outputStream.write(LittleEndianBinUtils.floatToByteArray(vertex)); | ||
} | ||
} | ||
|
||
public List<Float> getVertices() { | ||
return vertices; | ||
} | ||
|
||
public void addNormal(float normal) { | ||
normals.add(normal); | ||
} | ||
|
||
public List<Float> getNormals() { | ||
return normals; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.