Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Pass a GeDynamicArray to a function

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 261 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 29/10/2008 at 02:32, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.1 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      Hi,

      in my plugin object's class, I declared a GeDynamicArray as a private member:

      > class OMyObject : public ObjectData \> { \>      private: \>           GeDynamicArray<Vector>ClonePos; \> \>      public: \>           ... \>           ... \> } \>

      In another .cpp file (included with a .h) I have some other functions that are not members of my plugin class. One of these functions needs access to the GeDynamicArray now.

      In the plugin object's cpp:

      > \> #include "myfunctions.h" \> ... \> ... \> ... \> OMyObject::GetVirtualObjects() \> { \>      ... \>      DoSomething(); \> } \>

      In myfunctions.cpp:

      > \> void dosomething() \> { \>      // Here I want to do something with the array \> } \>

      I got the tip to create public Methods for getting and setting the array in my plugin class:

      > class OMyObject : public ObjectData \> { \>      private: \>           GeDynamicArray<Vector>ClonePos; \> \>      public: \>           GetArray(); \>           SetArray(); \> } \>

      First of all, I don't know how to do this exactly (sorry, I know this is C++ basics).

      Second of all, is there really no way to pass the GeDynamicArray as a reference argument to the "dosomething" function? Passing it like a normal argument would make things so much easier, I think.

      Open for suggestions and thankful for any tips and help.

      Regards & Greetings,
      Jack

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 30/10/2008 at 04:37, xxxxxxxx wrote:

        Yes, this is C++ basics, so you can look it up for yourself. And also look for function pointers for your other problem.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 30/10/2008 at 07:39, xxxxxxxx wrote:

          Got it, thanks 🙂

          Cheers,
          Jack

          1 Reply Last reply Reply Quote 0
          • First post
            Last post