|
@@ -2,37 +2,12 @@ Sidebar.Geometry = function ( editor ) {
|
|
|
|
|
|
var signals = editor.signals;
|
|
var signals = editor.signals;
|
|
|
|
|
|
- var geometryClasses = {
|
|
|
|
-
|
|
|
|
- "CircleGeometry": THREE.CircleGeometry,
|
|
|
|
- "CubeGeometry": THREE.CubeGeometry,
|
|
|
|
- "CylinderGeometry": THREE.CylinderGeometry,
|
|
|
|
- "ExtrudeGeometry": THREE.ExtrudeGeometry,
|
|
|
|
- "IcosahedronGeometry": THREE.IcosahedronGeometry,
|
|
|
|
- "LatheGeometry": THREE.LatheGeometry,
|
|
|
|
- "OctahedronGeometry": THREE.OctahedronGeometry,
|
|
|
|
- "ParametricGeometry": THREE.ParametricGeometry,
|
|
|
|
- "PlaneGeometry": THREE.PlaneGeometry,
|
|
|
|
- "PolyhedronGeometry": THREE.PolyhedronGeometry,
|
|
|
|
- "ShapeGeometry": THREE.ShapeGeometry,
|
|
|
|
- "SphereGeometry": THREE.SphereGeometry,
|
|
|
|
- "TetrahedronGeometry": THREE.TetrahedronGeometry,
|
|
|
|
- "TextGeometry": THREE.TextGeometry,
|
|
|
|
- "TorusGeometry": THREE.TorusGeometry,
|
|
|
|
- "TorusKnotGeometry": THREE.TorusKnotGeometry,
|
|
|
|
- "TubeGeometry": THREE.TubeGeometry,
|
|
|
|
- "Geometry": THREE.Geometry,
|
|
|
|
- "BufferGeometry": THREE.BufferGeometry
|
|
|
|
-
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
var container = new UI.Panel();
|
|
var container = new UI.Panel();
|
|
container.setBorderTop( '1px solid #ccc' );
|
|
container.setBorderTop( '1px solid #ccc' );
|
|
container.setPadding( '10px' );
|
|
container.setPadding( '10px' );
|
|
container.setDisplay( 'none' );
|
|
container.setDisplay( 'none' );
|
|
|
|
|
|
- var objectType = new UI.Text().setColor( '#666' ).setTextTransform( 'uppercase' );
|
|
|
|
- container.add( objectType );
|
|
|
|
|
|
+ container.add( new UI.Text().setValue( 'GEOMETRY' ).setColor( '#666' ) );
|
|
container.add( new UI.Break(), new UI.Break() );
|
|
container.add( new UI.Break(), new UI.Break() );
|
|
|
|
|
|
// uuid
|
|
// uuid
|
|
@@ -62,6 +37,16 @@ Sidebar.Geometry = function ( editor ) {
|
|
|
|
|
|
container.add( geometryNameRow );
|
|
container.add( geometryNameRow );
|
|
|
|
|
|
|
|
+ // class
|
|
|
|
+
|
|
|
|
+ var geometryTypeRow = new UI.Panel();
|
|
|
|
+ var geometryType = new UI.Text().setWidth( '150px' ).setColor( '#444' ).setFontSize( '12px' );
|
|
|
|
+
|
|
|
|
+ geometryTypeRow.add( new UI.Text( 'Class' ).setWidth( '90px' ).setColor( '#666' ) );
|
|
|
|
+ geometryTypeRow.add( geometryType );
|
|
|
|
+
|
|
|
|
+ container.add( geometryTypeRow );
|
|
|
|
+
|
|
// vertices
|
|
// vertices
|
|
|
|
|
|
var geometryVerticesRow = new UI.Panel();
|
|
var geometryVerticesRow = new UI.Panel();
|
|
@@ -108,7 +93,7 @@ Sidebar.Geometry = function ( editor ) {
|
|
|
|
|
|
container.setDisplay( 'block' );
|
|
container.setDisplay( 'block' );
|
|
|
|
|
|
- objectType.setValue( getGeometryInstanceName( object.geometry ) );
|
|
|
|
|
|
+ geometryType.setValue( editor.getGeometryType( object.geometry ) );
|
|
|
|
|
|
updateFields( geometry );
|
|
updateFields( geometry );
|
|
|
|
|
|
@@ -205,16 +190,6 @@ Sidebar.Geometry = function ( editor ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function getGeometryInstanceName( geometry ) {
|
|
|
|
-
|
|
|
|
- for ( var key in geometryClasses ) {
|
|
|
|
-
|
|
|
|
- if ( geometry instanceof geometryClasses[ key ] ) return key;
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return container;
|
|
return container;
|
|
|
|
|
|
}
|
|
}
|