Inherits from UIView
Declared in GWGeometryView.h

Overview

The GWGeometryView is the entry point of the Geometry Widget.

Properties

backgroundView

Background view of the writing area.

@property (strong, nonatomic) UIView *backgroundView

Discussion

The view is automatically resized to match the size of the Geometry Widget View.

The default background view is a UIImageView displaying a graph paper pattern. You can set this property to nil to remove the background.

Declared In

GWGeometryView.h

delegate

The receiver’s delegate or nil if it doesn’t have a delegate.

@property (assign, nonatomic) id<GWGeometryViewDelegate> delegate

Discussion

See GWGeometryViewDelegate for the methods this delegate can implement.

Declared In

GWGeometryView.h

inkColor

Color style of the ink:

@property (strong, nonatomic) NSString *inkColor

Discussion

1) in styles.css add your color sub style : .primitiveMyColor { color: #123456ff; }

2) use/select your color sub style like this: widget.inkColor = @“primitiveMyColor”

If new color sub style is invalid, current color sub style will be unchanged.

Declared In

GWGeometryView.h

inkDashed

Dash aspect for the ink. False : The ink is not dashed (default). True : The ink is dashed.

@property (assign, nonatomic) BOOL inkDashed

Discussion

The default value of this property is NO.

Declared In

GWGeometryView.h

inkThickness

Thickness style of the ink.

@property (assign, nonatomic) NSString *inkThickness

Discussion

1) in styles.css add your thickness sub style : .primitiveMyThickness { -myscript-pen-width:1.6; }

2) use/select your thickness sub style like this: widget.inkThickness = @“primitiveMyThickness”

If new thickness sub style is invalid, current thickness sub style will be unchanged.

Declared In

GWGeometryView.h

isEmpty

Returns a Boolean value that indicates whether the Geometry Widget contains items (primitives or constraints).

@property (assign, nonatomic, readonly) BOOL isEmpty

Return Value

YES if the Geometry Widget does not contain any items, otherwise NO.

Declared In

GWGeometryView.h

palmRejectionEnabled

A Boolean value that determines whether the Geometry Widget should ignore unwanted touches caused by the user palm.

@property (assign, nonatomic) BOOL palmRejectionEnabled

Discussion

The default value of this property is YES.

Declared In

GWGeometryView.h

palmRejectionLeftHanded

A Boolean value that determines whether the Geometry Rejection should be configured for left handed users.

@property (assign, nonatomic) BOOL palmRejectionLeftHanded

Discussion

The default value of this property is NO.

Declared In

GWGeometryView.h

Instance Methods

addSearchDir:

Add given directory to handwriting resources search path. Directory name can point to a folder in the file system, or to a directory in a zip file.

- (void)addSearchDir:(NSString *)directoryName

Parameters

directoryName

Path to a folder containing handwriting resources.

Declared In

GWGeometryView.h

boolValueForParameter:

Returns state for the specified GWBoolParameter key.

- (BOOL)boolValueForParameter:(GWBoolParameter)key

Parameters

key

see type GWBoolParameter.

Return Value

Boolean that determines state for the specified GWBoolParameter key.

Declared In

GWGeometryView.h

canRedo

Returns a Boolean value that indicates whether the Geometry Widget has any actions to redo.

- (BOOL)canRedo

Return Value

YES if the Geometry Widget has any actions to redo, otherwise NO.

Declared In

GWGeometryView.h

canUndo

Returns a Boolean value that indicates whether the Geometry Widget has any actions to undo.

- (BOOL)canUndo

Return Value

YES if the Geometry Widget has any actions to undo, otherwise NO.

Declared In

GWGeometryView.h

clear:

Clears all primitives & constraints.

- (void)clear:(BOOL)allowUndo

Parameters

allowUndo

YES to allow the undo, NO otherwise.

Declared In

GWGeometryView.h

clearSearchPath

Clear handwriting resources search path.

- (void)clearSearchPath

Declared In

GWGeometryView.h

configureWithBundle:andConfig:

Configure handwriting recognition engine. This method is non-blocking and returns immediately.

- (void)configureWithBundle:(NSString *)bundleName andConfig:(NSString *)configName

Parameters

bundleName

Name of the configuration bundle (for example, “shape”).

configName

Name of the configuration mode (for example, “standard”).

Discussion

Configuration is a lengthy process that may take up to several seconds, depending on the handwriting resources to be configured. It is recommended to setup a configuration listener to detect the end of the configuration process.

Declared In

GWGeometryView.h

enabledConstraintsForBehavior:

Returns the constraints for which the specified behavior is active.

- (GWConstraint)enabledConstraintsForBehavior:(GWConstraintBehavior)behavior

Parameters

behavior

The behavior

Return Value

An integer bit mask that determines the constraints for which the specified behavior is active.

Declared In

GWGeometryView.h

floatMaxValueForParameter:

Returns the maximun value allowed for the specified GWFloatParameter key.

- (CGFloat)floatMaxValueForParameter:(GWFloatParameter)key

Parameters

key

see type GWFloatParameter.

Return Value

Float that determines the minimun value allowed for the specified GWFloatParameter key.

Declared In

GWGeometryView.h

floatMinValueForParameter:

Returns the minimun value allowed for the specified GWFloatParameter key.

- (CGFloat)floatMinValueForParameter:(GWFloatParameter)key

Parameters

key

see type GWFloatParameter.

Return Value

Float that determines the minimun value allowed for the specified GWFloatParameter key.

Declared In

GWGeometryView.h

floatValueForParameter:

Returns value for the specified GWFloatParameter key.

- (CGFloat)floatValueForParameter:(GWFloatParameter)key

Parameters

key

see type GWFloatParameter.

Return Value

Float that determines state for the specified GWFloatParameter key.

Declared In

GWGeometryView.h

redo

Performs one redo step.

- (void)redo

Declared In

GWGeometryView.h

registerCertificate:

Register MyScript engine certificate.

- (BOOL)registerCertificate:(NSData *)certificate

Parameters

certificate

The data object containing the certificate.

Return Value

YES if the certificate is registered, NO on failure or if a certificate is already registered.

Declared In

GWGeometryView.h

resultAsImage

Get the geometry drawing as an image.

- (UIImage *)resultAsImage

Return Value

A UIImage similar to what is is displayed by the Geometrys Widget.

Declared In

GWGeometryView.h

serialize

Serialize the current input.

- (NSData *)serialize

Return Value

A data object containing the serialized equation.

Discussion

This method can be used to save an equation as binary data.

Declared In

GWGeometryView.h

setBoolValue:forParameter:

Set the state for the specified GWBoolParameter key.

- (void)setBoolValue:(bool)boolValue forParameter:(GWBoolParameter)key

Parameters

boolValue

A boolean specifying the state for the specified GWBoolParameter key.

key

see type GWBoolParameter.

Declared In

GWGeometryView.h

setConstraintsEnabled:constraints:forBehavior:

Enable or disable detection and display of implicit and explicit constraints.

- (void)setConstraintsEnabled:(BOOL)enabled constraints:(GWConstraint)constraints forBehavior:(GWConstraintBehavior)behavior

Parameters

enabled

A boolean specifying if the constraints should be enabled or disabled

constraints

An integer bit mask that determines the affected constraints

behavior

The affected behavior

Discussion

Use this method to enable or disable detection and display of implicit and explicit constraints. For example, to enable display of explicit angle equalities and perpendicularities, call: [geometryView setConstraintsEnabled:YES constraints:GWConstraintAngleValue | GWConstraintPerpendicularity forBehavior:GWConstraintBehaviorExplicitDisplay].

Declared In

GWGeometryView.h

setEditLabel:uniqueId:

Set the label of a given item.

- (void)setEditLabel:(NSString *)label uniqueId:(int64_t)uniqueId

Parameters

label

New label for the the item.

uniqueId

Unique Id of the item.

Declared In

GWGeometryView.h

setFloatValue:forParameter:

Set the value for the specified GWFloatParameter key.

- (void)setFloatValue:(CGFloat)floatValue forParameter:(GWFloatParameter)key

Parameters

floatValue

A float specifying the value for the specified GWFloatParameter key.

key

see type GWFloatParameter.

Declared In

GWGeometryView.h

setValue:uniqueId:

Set the value of a given item.

- (void)setValue:(float)value uniqueId:(int64_t)uniqueId

Parameters

value

New value for the item.

uniqueId

Unique Id of the item.

Declared In

GWGeometryView.h

undo

Performs one undo step.

- (void)undo

Declared In

GWGeometryView.h

unserialize:

Restore an input saved using the serialize method.

- (BOOL)unserialize:(NSData *)data

Parameters

data

The data to unserialize, provided by serialize.

Return Value

YES if the data was properly unserialized, NO otherwise.

Discussion

This method can be used to restore an equation from binary data.

Declared In

GWGeometryView.h