CLxImpl Tool

Introduction

The CLxImpl_Tool interface contains the core methods we will use to build our tool and must always be included when creating a tool. It should be noted that some of the methods within CLxImpl_Tool are also dependant on other packages however where possible I will mention these.

1
2
3
4
5
6
7
8
#include <lx_layer.hpp>
#include <lx_tool.hpp>

class BasicTool : public CLxImpl_Tool
{
public:
    BasicTool();
}

Interface Methods

tool_Reset()

The Reset method sets the tool attributes back to their initial/default state(as defined within the constructor).

Header Definition

1
void              tool_Reset() LXx_OVERRIDE;

Implementation

1
2
3
4
5
void BasicTool::tool_Reset()
{
    attr_SetFlt(0, 0.0);
    attr_SetFlt(1, 0.0);
}

*attr_SetFlt, attr_SetBool, attr_SetInt, etc are used to reset different variable types. *The index is used to reference the required attribute in the order it was defined in. *The value argument is the value you wish it to reset to.

This method applys the tool, recursively applying any hierarchy of sub-tools. Naturally, it validates the tool state upon completion.

Header Definition

1
void              tool_Evaluate(ILxUnknownID vts) LXx_OVERRIDE;

Implementation

1
2
3
4
5
6
7
8
9
void BasicTool::tool_Evaluate(ILxUnknownID vts)
{
    double factorX, factorY;

    attr_GetFlt(0, &factorX);
    attr_GetFlt(1, &factorY);

    my_log.Info("Factor X: " + std::to_string(factorX) + " Factor Y: " + toString(factorY));
}

*attr_GetFlt can be used to retrieve a attribute for use within the tool.

This method returns the tool vector type, describing the vector packets required for processing.

Header Definition

1
LXtObjectID       tool_VectorType() LXx_OVERRIDE;

Implementation

1
2
3
4
LXtObjectID BasicTool::tool_VectorType()
{
    return v_type.m_loc;        // peek method; does not add-ref
}

tool_Task()

Specifies the type of task performed by the tool.

Header Definition

1
LXtID4            tool_Task() LXx_OVERRIDE;

Implementation

1
2
3
4
LXtID4 BasicTool::tool_Task()
{
    return LXi_TASK_ACTR;
}

Return Value

Description

LXi_TASK_ACEN

Refers to a action center, defines a position about which a tool operation is centered.

LXi_TASK_ACTR

A Actor or state altering tool, most tools will be made using this, refers to the primary tool in the tool pipe.

LXi_TASK_AXIS

Refers to the axis, defines a axis or co-ordinate suystem in which a tool operates.

LXi_TASK_BRSH

Refers to a paint brush.

LXi_TASK_CONS

Refers to a constraint, constrains mouse events to move along a continuous surface

LXi_TASK_CONT

Refers to a content preset.

LXi_TASK_EFFR

Refers to a effector, read particles and effects at the position.

LXi_TASK_NOZL

Refers to a nozzle(used with brushes)

LXi_TASK_PATH

Refers to a path generator

LXi_TASK_PINK

Paint Ink

LXi_TASK_POST

Refers to a post apply actor

LXi_TASK_PTCL

Refers to a surface particle generator

LXi_TASK_SIDE

Not 100% Sure, by process of elimination I bielive it isthe visual aid - Adds to display without changing anything.

LXi_TASK_SNAP

Refers to the snap, attracts and locks mouse events to specific positions or elements.

LXi_TASK_STYL

Doesnt actually effect anything.

LXi_TASK_SYMM

Refers to tool symmetry

LXi_TASK_WGHT

Refers to the falloff, defines the strength of the tool operation through space.

LXs_TASK_WORK

Refers to the workplane.

tool_Order()

Specifies the order in the pipe, by returning an Ordinal string.

[https://i.ibb.co/T0k3sj5/tool-Basic-As-Action-Center.png|Action Center Order] [https://i.ibb.co/Lp8SPw9/tool-Basic-As-Falloff.png| Falloff Order]

Header Definition

1
const char *  tool_Order() LXx_OVERRIDE;

Implementation

1
2
3
4
const char *BasicTool::tool_Order()
{
    return LXs_ORD_ACTR;
}

Return Value

Description

LXs_ORD_ACEN

Refers to a action center, defines a position about which a tool operation is centered.

LXs_ORD_ACTR

A Actor or state altering tool, most tools will be made using this, refers to the primary tool in the tool pipe.

LXs_ORD_AXIS

Refers to the axis, defines a axis or co-ordinate suystem in which a tool operates.

LXs_ORD_BRSH

Refers to a paint brush.

LXs_ORD_CONS

Refers to a constraint, constrains mouse events to move along a continuous surface

LXs_ORD_CONT

Refers to a content preset.

LXs_ORD_EFFR

Refers to a effector, read particles and effects at the position.

LXs_ORD_NOZL

Refers to a nozzle(used with brushes)

LXs_ORD_PATH

Refers to a path generator

LXs_ORD_PINK

Paint Ink

LXs_ORD_POST

Refers to a post apply actor

LXs_ORD_PTCL

Refers to a surface particle generator

LXs_ORD_SIDE

Not 100% Sure, by process of elimination I bielive it isthe visual aid - Adds to display without changing anything.

LXs_ORD_SNAP

Refers to the snap, attracts and locks mouse events to specific positions or elements.

LXs_ORD_STYL

Doesnt actually effect anything.

LXs_ORD_SYMM

Refers to tool symmetry

LXs_ORD_WGHT

Refers to the falloff, defines the strength of the tool operation through space.

LXs_ORD_WORK

Refers to the workplane.

Undocumented Methods

I am currently giving these methods there own category as so far I have not been able to get them to work. They are related to procedural tools however please refer to the SDK docs for more info

tool_Sequence()

This method uses the attribute sequence object given to store the tool’s complete state by generating the sequence of attribute changes needed to reproduce that exact state. A tool whose state is expressed entirely by its attributes may return LXe_NOTIMPL from this method, and let the system build the sequence directly from the attribute list. //BasicToolCLxImpl_Tool::tool_Sequence ===

tool_ShouldBeAttribute(LXtID4 task)

int tool_ShouldBeAttribute(LXtID4 task)

tool_GetOp(void** ppvObj,unsigned flags)

LxResult tool_GetOp(void** ppvObj,unsigned flags)

tool_CompareOp(ILxUnknownID vts, LXtObjectID toolop)

int tool_CompareOp(ILxUnknownID vts, LXtObjectID toolop)

tool_UpdateOp(ILxUnknownID toolOP)

LxResult tool_UpdateOp(ILxUnknownID toolOP)