Stellarium  24.4
Public Slots | Public Member Functions
V3d Class Reference

V3d is a glue class to allow some interaction between Vec3d and the scripting system. More...

#include <V3d.hpp>

Public Slots

Q_INVOKABLE Vec3d toVec3d () const
 
Q_INVOKABLE Vec3f toVec3f () const
 
Q_INVOKABLE double x () const
 
Q_INVOKABLE double y () const
 
Q_INVOKABLE double z () const
 
Q_INVOKABLE void set (const double x, const double y, const double z)
 Sets the components.
 
Q_INVOKABLE void setX (double x)
 Sets the X component.
 
Q_INVOKABLE void setY (double y)
 Sets the Y component.
 
Q_INVOKABLE void setZ (double z)
 Sets the Z component.
 
Q_INVOKABLE QString toString () const
 Formats a comma-separated string in angle brackets. More...
 
Q_INVOKABLE QString toHex () const
 Formats a hex string usable as HTML color.
 

Public Member Functions

Q_INVOKABLE V3d (const V3d &other)
 
V3doperator= (const V3d &v)
 
Q_INVOKABLE V3d (const double x, const double y, const double z)
 The usual constructor to create a 3-dimensional vector that can be manipulated in JavaScript.
 
Q_INVOKABLE V3d (const Vec3d &vec)
 Create a 3-dimensional vector from a Vec3d that can later be manipulated in JavaScript, e.g. More...
 

Detailed Description

V3d is a glue class to allow some interaction between Vec3d and the scripting system.

Vec3f and Vec3d are not scriptable with the QJSEngine, but an intermediate V3d allows calling slots which require a Vec3f or Vec3d argument by calling like

This is especually helpful if you need to manipulate the V3d's components first. Else you can also just use

StelMovementMgr.setViewDirectionJ2000(core.vec3d(0., 1., 0.));

Constructor & Destructor Documentation

◆ V3d()

Q_INVOKABLE V3d::V3d ( const Vec3d vec)
inline

Create a 3-dimensional vector from a Vec3d that can later be manipulated in JavaScript, e.g.

Member Function Documentation

◆ toString

Q_INVOKABLE QString V3d::toString ( ) const
inlineslot

Formats a comma-separated string in angle brackets.

JS print output shows "V3d(address)". Use toVec3d() to show the values formatted by Vec3d's method.

◆ toVec3d

Q_INVOKABLE Vec3d V3d::toVec3d ( ) const
inlineslot
Returns
a Vec3d object which is not directly accessible by scripts but can be used as arguments to other calls.

◆ toVec3f

Q_INVOKABLE Vec3f V3d::toVec3f ( ) const
inlineslot
Returns
a Vec3f object which is not directly accessible by scripts but can be used as arguments to other calls.

◆ x

Q_INVOKABLE double V3d::x ( ) const
inlineslot
Returns
the X component

◆ y

Q_INVOKABLE double V3d::y ( ) const
inlineslot
Returns
the Y component

◆ z

Q_INVOKABLE double V3d::z ( ) const
inlineslot
Returns
the Z component