# `class WMSystem`

Available on all platforms

WMSystem, corresponding to a SCENE object

## Class Fields

### `static var readAtOnce:Bool`

global flag which defines the way to generate polygons. Default is true.

If this value is true, all the polygons are created by single call of gen(). All the objects are created at once.

If false, gen() will be called several times. Objects are shown in stepwise manner. This is suitable for large system.

### `static var readChainAtOnce:Bool`

Similar flag to `readAtOnce`. Default is true.

If this flag is true, polygons of chains (which consists RIBBONs and CHAINs) are created by a single calll of gen(). This means all the polygons of this object are created at once.

If false, gen() will be called several times. Objects of chains will be generated in stepwise fashion. If you have very large CHAIN in your xml data, try to use false.

### `static var readSize:Int`

approximate data size which is read by single call of gen() when readAtOnce is false

## Instance Fields

### `var autoScale:Bool`

is auto scaling activated?

### `var bgcolor:Int`

background color

### `var completed:Bool`

is reading completed?

### `var origin:Point3D`

origin of this SCENE

### `var reading:Bool`

is reading now?

### `var scaleFactor:Float`

scaling factor of coordinate

### `var scaleFactorManual:Float`

scaling factor in manual setting mode

### `function new():Void`

Constructor.

### `function clear():Void`

Clear objects such as ATOMs, BONDs and initialize some values.

### `function dispose():Void`

dispose shader instances

### `function draw(c:Context3D, mpos:Matrix3D, proj:Matrix3D, voffset:Vector3D, light:Vector3D, cpos:Vector3D, dcActive:Bool, dcCoeff:Float, dcLength:Float):Bool`

draw this SCENE

### `function dump():String`

returns a xml data of this SCENE

### `function empty():Bool`

is this instance empty? (true if this instance does not have ATOMs, BONDs, ... )

### `function gen(c:Context3D, is_dc_active:Bool, a:Array<WMAlias>, myxml:Xml):Void`

generate objects

### `function gen2(c:Context3D, is_dc_active:Bool):Void`

create polygons

### `function geometricCenter():Point3D`

return geometric center of this SCENE

### `function get_autoScale():Bool`

getter of `autoScale`

### `function get_bgcolor():Int`

getter of `bgcolor`

### `function get_completed():Bool`

getter of `completed`

### `function get_origin():Point3D`

getter of `origin`

### `function get_reading():Bool`

getter of `reading`

### `function get_scaleFactor():Float`

getter of `scaleFactor`

### `function get_scaleFactorManual():Float`

getter of `scaleFactorManual`

### `function initializeCrd():Void`

preparation of coordinate: removing translation and do scaling

### `function loadXML(myxml:Xml, aliases:Array<WMAlias>):Void`

load xml data if given by `myxml`

### `function numAtoms():Int`

returns number of ATOM elements

### `function numBonds():Int`

returns number of BOND elements

### `function numChains():Int`

returns number of CHAIN elements

### `function numShapes():Int`

returns number of SHAPE elements

### `function registerXml(myxml:Xml):Void`

set XML data corresponding to this SCENE; not read, just send xml data

### `function rescaleCoord():Void`

rescale coordinate according to the current stage width and height. This function will be called by RESCALE event handler. This does not work as desired yet...

### `function scaleCoord(scale:Float):Void`

scale all the object by `scale`

### `function set_autoScale(a:Bool):Bool`

setter of `autoScale`

### `function set_bgcolor(c:Int):Int`

setter of `bgcolor`

### `function set_origin(p:Point3D):Point3D`

setter of `origin`

### `function set_scaleFactor(f:Float):Float`

setter of `scaleFactor`

### `function set_scaleFactorManual(f:Float):Float`

setter of `scaleFactorManual`

### `function size():Int`

number of objects of this SCENE

### `function translate(p:Point3D):Void`

translate all the objects of this instance by `p`