SoGeoOrigin(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

πŸ’– SoGeoOrigin πŸ’–

okay bestie, welcome to the manual page for SoGeoOrigin, straight out of the Library Functions Manual. It's a SoGeoOrigin(3) situation and we're gonna get into it πŸ’…

SoGeoOrigin β€” the class that lets you pin down one absolute geographic location, and then everything else's geometry gets referenced against that spot. Iconic, honestly. Like dropping a pin and saying "everybody orient yourselves to HERE." πŸ“βœ¨


🌍 NAME 🌍

SoGeoOrigin β€” this class is used to specify an absolute geographic location that geometry gets referenced against. That's the whole vibe. One anchor point, and the rest of your scene is like "okay so relative to her." 🫢


✨ SYNOPSIS ✨

#include <Inventor/nodes/SoGeoOrigin.h>

Lowkey important detail: it inherits SoNode. Family tree matters, bestie 🌳

πŸ‘‘ Public Member Functions πŸ‘‘

🌸 SoGeoOrigin's own, no middleman 🌸

  • virtual SoType getTypeId (void) const β€” hands you back the type id, virtual-style ✨
  • SoGeoOrigin (void) β€” the constructor. the birth. the origin story (literally) πŸŽ€
  • virtual void doAction (SoAction *action) β€” does the action thing πŸ’«
  • virtual void callback (SoCallbackAction *action) β€” runs the callback action, no cap
  • virtual void GLRender (SoGLRenderAction *action) β€” the render moment. main character energy πŸ”₯
  • virtual void getBoundingBox (SoGetBoundingBoxAction *action) β€” fetches the bounding box πŸ“¦
  • virtual void getMatrix (SoGetMatrixAction *action) β€” grabs the matrix, matrixing away 🧚
  • virtual void pick (SoPickAction *action) β€” pick action, as one does
  • virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action) β€” counts the primitives, she's thorough πŸ’…

πŸ’œ Public Member Functions inherited from SoNode

  • void setOverride (const SbBool state) β€” sets the override state
  • SbBool isOverride (void) const β€” is it overriding? a question only she can answer
  • void setNodeType (const NodeType type) β€” sets the node type
  • NodeType getNodeType (void) const β€” gets the node type
  • virtual SoNode * copy (SbBool copyconnections=FALSE) const β€” copies, and the connections copy flag defaults to FALSE btw
  • virtual SbBool affectsState (void) const β€” does it affect state? inquiring minds
  • virtual void GLRenderBelowPath (SoGLRenderAction *action) β€” renders below the path 🌈
  • virtual void GLRenderInPath (SoGLRenderAction *action) β€” renders in the path
  • virtual void GLRenderOffPath (SoGLRenderAction *action) β€” renders off the path (she contains multitudes)
  • virtual void handleEvent (SoHandleEventAction *action) β€” handles the event
  • virtual void rayPick (SoRayPickAction *action) β€” ray picks πŸ”¦
  • virtual void search (SoSearchAction *action) β€” searches
  • virtual void write (SoWriteAction *action) β€” writes
  • virtual void audioRender (SoAudioRenderAction *action) β€” audio render, sound on πŸ”Š
  • virtual void grabEventsSetup (void) β€” sets up the event grabbing
  • virtual void grabEventsCleanup (void) β€” cleans up the event grabbing
  • virtual void startNotify (void) β€” starts the notify
  • virtual void notify (SoNotList *l) β€” notifies, with the list l
  • uint32_t getNodeId (void) const β€” gets the node id
  • virtual SoChildList * getChildren (void) const β€” gets the children 🧸
  • virtual void writeInstance (SoOutput *out) β€” writes the instance out
  • virtual SoNode * addToCopyDict (void) const β€” adds herself to the copy dict, as she should
  • virtual void copyContents (const SoFieldContainer *from, SbBool copyconnections) β€” copies contents from a field container
  • virtual SoFieldContainer * copyThroughConnection (void) const β€” copies through the connection

πŸ¦‹ Public Member Functions inherited from SoFieldContainer

  • void setToDefaults (void) β€” back to defaults, reset era
  • SbBool hasDefaultValues (void) const β€” does it have default values?
  • SbBool fieldsAreEqual (const SoFieldContainer *container) const β€” are the fields equal to this container's? comparing girlies πŸ’…
  • void copyFieldValues (const SoFieldContainer *container, SbBool copyconnections=FALSE) β€” copies field values; connections flag defaults to FALSE
  • SbBool set (const char *const fielddata) β€” sets from field data
  • void get (SbString &fielddata) β€” gets field data into a string
  • virtual int getFields (SoFieldList &l) const β€” gets the fields into list l
  • virtual int getAllFields (SoFieldList &l) const β€” gets all the fields, no crumbs left
  • virtual SoField * getField (const SbName &name) const β€” gets one field by name
  • virtual SoField * getEventIn (const SbName &name) const β€” gets an event in by name
  • virtual SoField * getEventOut (const SbName &name) const β€” gets an event out by name
  • SbBool getFieldName (const SoField *const field, SbName &name) const β€” gets the name of a given field
  • SbBool enableNotify (const SbBool flag) β€” toggles notify with a flag
  • SbBool isNotifyEnabled (void) const β€” is notify enabled?
  • SbBool set (const char *fielddata, SoInput *input) β€” sets from field data, with an SoInput
  • void get (SbString &fielddata, SoOutput *out) β€” gets field data out, with an SoOutput
  • virtual SbBool validateNewFieldValue (SoField *field, void *newval) β€” validates a new field value
  • virtual void addWriteReference (SoOutput *out, SbBool isfromfield=FALSE) β€” adds a write reference; isfromfield defaults to FALSE
  • SbBool getIsBuiltIn (void) const β€” is it built in?
  • virtual void getFieldsMemorySize (size_t &managed, size_t &unmanaged) const β€” reports fields memory size in managed and unmanaged buckets
  • void setUserData (void *userdata) const β€” sets user data
  • void * getUserData (void) const β€” gets user data back

πŸŽ€ Public Member Functions inherited from SoBase

  • void ref (void) const β€” refs her up
  • void unref (void) const β€” unrefs her
  • void unrefNoDelete (void) const β€” unref but no delete, sneaky
  • int32_t getRefCount (void) const β€” gets the ref count
  • void touch (void) β€” touch. she felt that.
  • SbBool isOfType (SoType type) const β€” is she of this type?
  • virtual SbName getName (void) const β€” gets the name
  • virtual void setName (const SbName &newname) β€” sets a new name
  • void addAuditor (void *const auditor, const SoNotRec::Type type) β€” adds an auditor
  • void removeAuditor (void *const auditor, const SoNotRec::Type type) β€” removes an auditor
  • const SoAuditorList & getAuditors (void) const β€” gets the auditor list
  • SbBool shouldWrite (void) β€” should she write? only she knows
  • void assertAlive (void) const β€” asserts she's alive. dramatic but valid πŸ’€

⭐ Static Public Member Functions ⭐

🌟 Her own 🌟

  • static SoType getClassTypeId (void) β€” the class type id, statically
  • static void initClass (void) β€” initializes the class

🌟 Inherited from SoNode 🌟

  • static uint32_t getCompatibilityTypes (const SoType &nodetype) β€” gets compatibility types for a node type
  • static SoType getClassTypeId (void) β€” class type id
  • static SoNode * getByName (const SbName &name) β€” gets a node by name
  • static int getByName (const SbName &name, SoNodeList &l) β€” gets by name, into a node list
  • static void initClass (void) β€” init the class
  • static void initClasses (void) β€” init ALL the classes, plural, she's ambitious
  • static uint32_t getNextNodeId (void) β€” gets the next node id
  • static int getActionMethodIndex (const SoType type) β€” gets the action method index
  • static void getBoundingBoxS (SoAction *action, SoNode *node) β€” the static bounding box getter
  • static void GLRenderS (SoAction *action, SoNode *node) β€” the static GL render
  • static void callbackS (SoAction *action, SoNode *node) β€” the static callback
  • static void getMatrixS (SoAction *action, SoNode *node) β€” the static matrix getter
  • static void handleEventS (SoAction *action, SoNode *node) β€” the static event handler
  • static void pickS (SoAction *action, SoNode *node) β€” the static pick
  • static void rayPickS (SoAction *action, SoNode *node) β€” the static ray pick
  • static void searchS (SoAction *action, SoNode *node) β€” the static search
  • static void writeS (SoAction *action, SoNode *node) β€” the static write
  • static void audioRenderS (SoAction *action, SoNode *node) β€” the static audio render
  • static void getPrimitiveCountS (SoAction *action, SoNode *node) β€” the static primitive counter

🌟 Inherited from SoFieldContainer 🌟

  • static void initClass (void) β€” init
  • static SoType getClassTypeId (void) β€” class type id
  • static void cleanupClass (void) β€” cleanup, the class gets a skincare routine πŸ§–
  • static void initCopyDict (void) β€” init the copy dict
  • static void addCopy (const SoFieldContainer *orig, const SoFieldContainer *copy) β€” adds a copy, orig to copy
  • static SoFieldContainer * checkCopy (const SoFieldContainer *orig) β€” checks a copy
  • static SoFieldContainer * findCopy (const SoFieldContainer *orig, const SbBool copyconnections) β€” finds a copy, with the connections flag
  • static void copyDone (void) β€” copy done, periodt

🌟 Inherited from SoBase 🌟

  • static void initClass (void) β€” init
  • static SoType getClassTypeId (void) β€” class type id
  • static void addName (SoBase *const base, const char *const name) β€” adds a name to a base
  • static void removeName (SoBase *const base, const char *const name) β€” removes a name from a base
  • static void incrementCurrentWriteCounter (void) β€” bumps the current write counter
  • static void decrementCurrentWriteCounter (void) β€” lowers the current write counter
  • static SoBase * getNamedBase (const SbName &name, SoType type) β€” gets a named base by name and type
  • static int getNamedBases (const SbName &name, SoBaseList &baselist, SoType type) β€” gets named bases into a base list
  • static SbBool read (SoInput *input, SoBase *&base, SoType expectedtype) β€” reads, with the expected type
  • static void setInstancePrefix (const SbString &c) β€” sets the instance prefix
  • static void setTraceRefs (SbBool trace) β€” sets trace refs
  • static SbBool getTraceRefs (void) β€” gets trace refs
  • static SbBool connectRoute (SoInput *input, const SbName &fromnodename, const SbName &fromfieldname, const SbName &tonodename, const SbName &tofieldname) β€” connects a route, from node/field to node/field, so many params, she's doing the most
  • static SbBool readRoute (SoInput *input) β€” reads a route

πŸ’Ž Public Attributes πŸ’Ž

  • SoSFVec3d geoCoords β€” the geo coords, in a single-field SoSFVec3d
  • SoMFString geoSystem β€” the geo system, a multi-field SoMFString (multi, because options, bestie)

πŸ”’ Protected Member Functions πŸ”’

πŸ’— Her own πŸ’—

  • virtual const SoFieldData * getFieldData (void) const β€” gets the field data
  • virtual ~SoGeoOrigin () β€” the destructor, protected, don't touch 🚫

πŸ’— Inherited from SoNode πŸ’—

  • SoNode (void) β€” the SoNode constructor
  • virtual ~SoNode () β€” the SoNode destructor
  • virtual SbBool readInstance (SoInput *in, unsigned short flags) β€” reads an instance with flags

πŸ’— Inherited from SoFieldContainer πŸ’—

  • SoFieldContainer (void) β€” constructor
  • virtual ~SoFieldContainer () β€” destructor

πŸ’— Inherited from SoBase πŸ’—

  • SoBase (void) β€” constructor
  • virtual ~SoBase () β€” destructor
  • virtual void destroy (void) β€” destroy her
  • SbBool hasMultipleWriteRefs (void) const β€” does she have multiple write refs?
  • SbBool writeHeader (SoOutput *out, SbBool isgroup, SbBool isengine) const β€” writes the header with group and engine flags
  • void writeFooter (SoOutput *out) const β€” writes the footer
  • virtual const char * getFileFormatName (void) const β€” gets the file format name

🫧 Static Protected Member Functions 🫧

🌺 Her own 🌺

  • static const SoFieldData ** getFieldDataPtr (void) β€” gets the field data pointer

🌺 Inherited from SoNode 🌺

  • static const SoFieldData ** getFieldDataPtr (void) β€” field data pointer
  • static void setNextActionMethodIndex (int index) β€” sets the next action method index
  • static int getNextActionMethodIndex (void) β€” gets the next action method index
  • static void incNextActionMethodIndex (void) β€” increments the next action method index
  • static void setCompatibilityTypes (const SoType &nodetype, const uint32_t bitmask) β€” sets compatibility types with a bitmask

🌺 Inherited from SoBase 🌺

  • static uint32_t getCurrentWriteCounter (void) β€” gets the current write counter
  • static void staticDataLock (void) β€” locks the static data πŸ”
  • static void staticDataUnlock (void) β€” unlocks the static data πŸ”“

🌈 Additional Inherited Members 🌈

🎠 Public Types inherited from SoNode 🎠

the enum, in all her glory, values EXACTLY as written:

enum NodeType { INVENTOR = 0x0000, VRML1 = 0x0001, VRML2 = 0x0002,
    INVENTOR_1 = 0x0004, INVENTOR_2_0 = 0x0008, INVENTOR_2_1 = 0x0010,
    INVENTOR_2_5 = 0x0020, INVENTOR_2_6 = 0x0040, COIN_1_0 = 0x0080,
    COIN_2_0 = 0x0100, EXTENSION = 0x0200, COIN_2_2 = 0x0400, COIN_2_3 =
    0x0800, COIN_2_4 = 0x1000, INVENTOR_5_0 = 0x2000, COIN_2_5 = 0x4000,
    COIN_3_0 = 0x8000, INVENTOR_6_0 = 0x10000 }

🎠 Protected Types inherited from SoBase 🎠

enum BaseFlags { IS_ENGINE = 0x01, IS_GROUP = 0x02 }

πŸŽ€ Protected Attributes inherited from SoNode πŸŽ€

  • uint32_t uniqueId β€” her unique id, obviously unique, obviously iconic

πŸŽ€ Protected Attributes inherited from SoFieldContainer πŸŽ€

  • SbBool isBuiltIn β€” is she built in or not

πŸŽ€ Static Protected Attributes inherited from SoNode πŸŽ€

  • static uint32_t nextUniqueId = 1 β€” starts at 1, don't forget
  • static int nextActionMethodIndex = 0 β€” starts at 0

…and bestie, we are SO not done. Part 2 is pulling up πŸ’–πŸ§šβœ¨

πŸ—ΊοΈ Detailed Description πŸ—ΊοΈ

Okay so SoGeoOrigin is the class that lets you drop an absolute geographic location into your scene, and everything else gets referenced against it. It's giving "pin in the map" energy. πŸ“

πŸ“ FILE FORMAT/DEFAULTS πŸ“

GeoOrigin {
  geoSystem ["GD", "WE"]
  geoCoords 0 0 0
}

Now, real talk: a huge common problem when dealing with geographic data is that floating point precision gets absolutely wrecked. UTM coordinates are often in the 10^5 a 10^6 magnitude, and that leaves very little precision for details at that position. It's giving squished. 😭

That's exactly why the SoGeo nodes exist β€” you can keep your data in its original system but still get good floating point precision when rendering. Iconic, honestly. ✨

Coin needs a local Cartesian coordinate system when rendering. When a SoGeoOrigin node is used, Coin will create a coordinate system at the SoGeoOrigin position, and all geometry (and the camera) in the scene graph will be projected into that coordinate system. No cap.

The coordinate system will always have the Z axis point up from the ground. The Y axis will point towards the north pole, and the X-axis is found using the right hand rule. Slay.

A scene graph should only contain one GeoOrigin node, and all geometry in the scene graph will, as stated earlier, be rendered relative to this position. This means that the precision will be best if the GeoOrigin position is as close to actual camera position as possible. If you move around on a large area, it might therefore be a good idea to actually move the GeoOrigin position instead of the camera. Lowkey genius. 🧠

To place geometry in the scene graph, you can either use an SoGeoSeparator node or an SoGeoCoordinate node. When using a GeoSeparator node, all geometry inside that separator will be rendered relative to its geo-system position and orientation, and you then use regular shapes and regular SoCoordinate3 nodes to specify data (the points in an SoCoordinate3 must be adjusted to be relative to the GeoSeparator position).

The SoGeoCoordinate node on the other hand can contain double precision geo-coordinates, and that node will internally recalculate the double precision array to a single precision array which is relative to the SoGeoOrgin node (spelled exactly like that, bestie).

One note regarding UTM projections: Since it's quite common to assume a flat earth when working with UTM data, it's possible to supply a "FLAT" keyword for UTM coordinate systems:

GeoOrigin {
  geoSystem [ "UTM", "Z17", "FLAT" ]
  geoCoords  846889 4313850 0
}

Example scene graph, bestie:

GeoOrigin { geoSystem "GD" geoCoords 40.77 -73.97 0 }

GeoSeparator {
  # New York, NY
  geoSystem  "GD"
  geoCoords 40.67 -73.94 0

  BaseColor { rgb 0 1 0 }
  Cube { width 25000 height 25000 depth 25000 }
  Translation { translation 0 0 30000 }
  Text2 { string "New York" }
}

GeoSeparator {
  # Los Angeles, CA
  geoSystem "GD"
  geoCoords 34.11 -118.4 0

  BaseColor { rgb 1 0 0 }
  Cube { width 25000 height 25000 depth 25000 }
  Translation { translation 0 0 30000 }
  Text2 { string "Los Angeles" }
}

GeoSeparator {
  # Washington, DC
  geoSystem [ "UTM", "Z17" ]
  geoCoords  846889 4313850 0

  BaseColor { rgb 0 1 1 }
  Cube { width 25000 height 25000 depth 25000 }

  Translation { translation 0 0 30000 }
  Text2 { string "Washington" }
}

# add a small geogrid
GeoCoordinate {
  geoSystem "GD"
  point [
  32 -120 0,
  32 -110 0,
  32 -100 0,
  32 -90 0,
  32 -80 0,
  32 -70 0,

  34 -120 0,
  34 -110 0,
  34 -100 0,
  34 -90 0,
  34 -80 0,
  34 -70 0,

  36 -120 0,
  36 -110 0,
  36 -100 0,
  36 -90 0,
  36 -80 0,
  36 -70 0,

  38 -120 0,
  38 -110 0,
  38 -100 0,
  38 -90 0,
  38 -80 0,
  38 -70 0,

  40 -120 0,
  40 -110 0,
  40 -100 0,
  40 -90 0,
  40 -80 0,
  40 -70 0

  42 -120 0,
  42 -110 0,
  42 -100 0,
  42 -90 0,
  42 -80 0,
  42 -70 0
  ]
}

DrawStyle { style LINES }
BaseColor {}
ShapeHints { vertexOrdering COUNTERCLOCKWISE }
QuadMesh { verticesPerRow 6 verticesPerColumn 6 }

Since πŸ•°οΈ

Coin 2.5


πŸ› οΈ Constructor & Destructor Documentation πŸ› οΈ

SoGeoOrigin::SoGeoOrigin (void )

Constructor. That's it. It constructs. πŸ’…

SoGeoOrigin::~SoGeoOrigin () [protected], [virtual]

Destructor. It destructs. Protected and virtual, iykyk.


πŸ“š Member Function Documentation πŸ“š

SoType SoGeoOrigin::getTypeId (void ) const [virtual]

Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and "downward" casting.

Usage example:

void foo(SoNode * node)
{
  if (node->getTypeId() == SoFile::getClassTypeId()) {
    SoFile * filenode = (SoFile *)node;  // safe downward cast, knows the type
  }
}

For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.

For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.

Implements SoBase.

const SoFieldData * SoGeoOrigin::getFieldData (void ) const [protected], [virtual]

Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

Reimplemented from SoFieldContainer.

void SoGeoOrigin::doAction (SoAction * action) [virtual]

This function performs the typical operation of a node for any action.

Reimplemented from SoNode.

void SoGeoOrigin::callback (SoCallbackAction * action) [virtual]

Action method for SoCallbackAction.

Simply updates the state according to how the node behaves for the render action, so the application programmer can use the SoCallbackAction for extracting information about the scene graph.

Reimplemented from SoNode.

void SoGeoOrigin::GLRender (SoGLRenderAction * action) [virtual]

Action method for the SoGLRenderAction.

This is called during rendering traversals. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method.

Reimplemented from SoNode.

void SoGeoOrigin::getBoundingBox (SoGetBoundingBoxAction * action) [virtual]

Action method for the SoGetBoundingBoxAction.

Calculates bounding box and center coordinates for node and modifies the values of the action to encompass the bounding box for this node and to shift the center point for the scene more towards the one for this node.

Nodes influencing how geometry nodes calculates their bounding box also overrides this method to change the relevant state variables.

Reimplemented from SoNode.

void SoGeoOrigin::getMatrix (SoGetMatrixAction * action) [virtual]

Action method for SoGetMatrixAction.

Updates action by accumulating with the transformation matrix of this node (if any).

Reimplemented from SoNode.

void SoGeoOrigin::pick (SoPickAction * action) [virtual]

Action method for SoPickAction.

Does common processing for SoPickAction action instances.

Reimplemented from SoNode.

void SoGeoOrigin::getPrimitiveCount (SoGetPrimitiveCountAction * action) [virtual]

Action method for the SoGetPrimitiveCountAction.

Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action.

Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables.

Reimplemented from SoNode.


πŸ“¦ Member Data Documentation πŸ“¦

SoSFVec3d SoGeoOrigin::geoCoords

Used for specifying the geographic coordinates. For the GD system this should be <latitude> <longitude> <elevation>. For UTM it is <easting> <northing> <elevation>, and for GC it is simply <x> <y> <z>.

SoMFString SoGeoOrigin::geoSystem

Used to specify a spatial reference frame. Coin currently supports three different systems. Support for more systems might be added in the future.

  • "GD" β€” The Geodetic system (latitude/longitude).
  • "UTM" β€” Universal Transverse Mercator coordinate system. The second string should be the zone, encoded as "Z<n>".
  • "GC" β€” Earth-fixed Geocentric with respect to the WGS84 ellipsoid.

The "GD" and "UTM" systems can, for future support, have an ellipsoid specification. The default is "WE" which is the WGS84 ellipsoid, the only ellipsoid currently supported in Coin.


✍️ Author ✍️

Generated automatically by Doxygen for Coin from the source code.


That's the whole vibe, bestie. This page was generated automatically by Doxygen for Coin from the source code, and it's from Coin Version 3.1.3, manual page SoGeoOrigin(3). Stay precise. πŸ’–βœ¨

πŸ“¦ where this page comes from