Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
Release notes Open Inventor 10.6

Compatibility notes

The following notes mention the API or behavior changes made in this version compared to Open Inventor 10.5.

Open Inventor core

  • SoShapeHighlightRenderAction has been removed.
    As it was tagged SoINTERNAL, it has never been officially supported. In any case, if your application used it you must now replace it by the new SoColorHighlightRenderAction
  • SoUpdateAreaElement: size set by SoUpdateAreaElement::set was previously interpreted as a ratio. Starting with Open Inventor 10.6 it is read as a number of pixels

RemoteViz

In order to provide your application with safer lifetime control on objects shared by RemoteViz, the API of RemoteViz is updated in Open Inventor 10.6. The following document describes all the changes introduced and will help you to port your application using this new API. In addition to the API changes related to the usage of shared pointer, following API changes occured:

Class ServiceSettings
Before 10.6, for a newly created ServiceSettings object, the default value of the IP attribute was “auto”. Starting with version 10.6, the value “auto” has been removed and the default IP value is now “127.0.0.1”. See the setIP() and getIP() methods.

C++ pointers

All arguments and return types using a pointer type are replaced by the equivalent shared pointer type. In other words, “Type* arg” will become “std::shared_ptr<Type> arg”. The shared_ptr type allows more than one owner to manage the lifetime of an object in memory. This is important if the application needs to hold a pointer to a RemoteViz object, for example, a RenderArea. Previously when RemoteViz was finished using an object, it would explicitly delete the object, making the pointer held by the application invalid. Now when RemoteViz is finished using an object, it calls the shared_ptr’s reset() method. If there is no other shared_ptr referencing the object, the object is deleted. But if the application is holding a shared_ptr, that pointer and the object remain valid (until the application resets its shared_ptr).

This API change breaks source compatibility and generates errors with existing code. To fix these errors, replace pointers with shared pointers in your source code. To give you an idea of how this will change your code, consider the basic HelloCone example program (examples/source/RemoteViz/HelloCone).

Service main
Open Inventor 10.5

// Instantiate a service settings class
ServiceSettings settings;
. . .
// Open the service by using the settings
if (Service::instance()->open(&settings))

Open Inventor 10.6

// Instantiate a service settings class
auto settings = std::make_shared<ServiceSettings>();
. . .
// Open the service by using the settings
if (Service::instance()->open(settings))

ServiceListener.h
Open Inventor 10.5

virtual void onInstantiatedRenderArea(RemoteViz::Rendering::RenderArea *renderArea);

Open Inventor 10.6

virtual void onInstantiatedRenderArea(std::shared_ptr<RemoteViz::Rendering::RenderArea> renderArea) override;

ServiceListener.cxx
Open Inventor 10.5

void MyServiceListener::onInstantiatedRenderArea(RemoteViz::Rendering::RenderArea *renderArea)
{
    // Instantiate a renderAreaListener class to manage the renderArea events (default behaviors).
    std::shared_ptr renderAreaListener(new RemoteViz::Rendering::RenderAreaListener());
    . . .
}

Open Inventor 10.6

void MyServiceListener::onInstantiatedRenderArea(std::shared_ptr<RemoteViz::Rendering::RenderArea> renderArea)
{
    // Instantiate a renderAreaListener class to manage the renderArea events (default behaviors).
    auto renderAreaListener = std::make_shared<RemoteViz::Rendering::RenderAreaListener>();
    . . .
}

C++ derived classes

We strongly recommend using the C++11 keyword “override” in all classes derived from the RemoteViz classes ServiceListener and RenderAreaListener so that the compiler checks that the virtual methods successfully override the corresponding virtual method in the base class.

C++ API change

  • class Connection
    • bool sendMessage (const unsigned char* buffer, size_t size) const;
      is replaced by
      bool sendMessage(const std::vector<const unsigned char>& buffer) const;
    • New function bool Connection::isOpen() has been added to gets the state of a Connection (open or closed)
  • class Client
    • bool sendMessage(const std::string& message, Connection** excludedConnections = nullptr, unsigned int num = 0) const;
      is replaced by
      bool sendMessage(const std::string& message, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
    • bool sendMessage (const unsigned char *buffer, size_t size, Connection **excludedConnections=nullptr, unsigned int num=0) const;
      is replaced by
      bool sendMessage(const std::vector<const unsigned char>& buffer, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
    • New property Client::isConnected() has been added to get the state of the Client (connected or disconnected)
  • class RenderArea
    • bool sendMessage(const std::string& message, Connection** excludedConnections = nullptr, unsigned int num = 0) const;
      is replaced by
      bool sendMessage(const std::string& message, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
    • bool sendMessage (const unsigned char *buffer, size_t size, Connection **excludedConnections=nullptr, unsigned int num=0) const;
      is replaced by
      bool sendMessage(const std::vector<const unsigned char>& buffer, std::vector<std::shared_ptr<Connection>> excludedConnections = {}) const;
    • New function RenderArea::isDisposed() has been added to get the state of the RenderArea (alive or disposed)

Java API change

  • class Connection
    • SendMessage(byte[] buffer)
      is replaced by
      SendMessage(Collection<Byte> buffer)
    • New function boolean isOpen() has been added to get the state of a Connection (open or closed)
  • class Client and class RenderArea
    • SendMessage(byte[] buffer)
      is replaced by
      SendMessage(Collection<Byte> buffer)
    • SendMessage(byte[] buffer, Connection[] excludedConnections)
      is replaced by
      SendMessage(Collection<byte> buffer, Collection<Connection> excludedConnections)
    • SendMessage(string message, Connection[] excludedConnections)
      is replaced by
      SendMessage(string message, Collection<Connection> excludedConnections)
    • New function boolean isConnected() has been added in class Client to get the state of the Client (connected or disconnected)
    • New function bool isDisposed() has been added to class RenderArea to get the state of a RenderArea (alive or disposed)
  • class ServiceListener
    • OnReceivedMessage(RenderArea, Connection, byte[])
      is replaced by
      OnReceveivedMessage(RenderArea renderArea, Connection sender, Collection<Byte> buffer)

.NET API change

  • class Connection
    • SendMessage(byte[] buffer)
      is replaced by
      SendMessage(IList<byte> buffer)
    • New property IsOpen has been added to get the state of a Connection (open or closed)
  • class Client and class RenderArea
    • SendMessage(byte[] buffer)
      is replaced by
      SendMessage(IList<byte> buffer)
    • SendMessage(byte[] buffer, Connection[] excludedConnections)
      is replaced by
      SendMessage(IList buffer<byte>, IList<Connection> excludedConnections)
    • SendMessage(string message, Connection[] excludedConnections)
      is replaced by
      SendMessage(string message, IList<Connection> excludedConnections)
    • New property IsConnected has been added in Client class to get the state of the Client (connected or disconnected)
    • New property IsDisposed has been added to class RenderArea to get the state of a RenderArea (alive or disposed)
  • class ServiceListener
    • OnReceivedMessage(RenderArea, Connection, Byte[])
      is replaced by
      OnReceveivedMessage(RenderArea renderArea, Connection sender, IList<byte> buffer)