Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[MS Connect U14 MDL/C++] Replacement for referenceFile.h functions AllowActivation(), Activate() and ReleaseWriteLock()

$
0
0

Hi,

migrating an old V8i MDL application I'm missing the functions AllowActivation(), Activate() and ReleaseWriteLock() formerly defined in referenceFile.h:

/*--------------------------------------------------------------------------------------+
|
|
|   $Copyright: (c) 2008 Bentley Systems, Incorporated. All rights reserved. $
|
|
+--------------------------------------------------------------------------------------*/
#pragma once


#ifdef  __cplusplus

#include <refernce.h>
#include <msdgnmodelref.fdf>
#include <msdgncache.fdf>
#include <viewcontext.h>
#include <vector>

typedef std::vector <struct GPArray*> RefClipCurves;

#ifdef REFERENCE_FILE_CLASS
/*=================================================================================**//**
* A ReferenceFile is an object that is the in-memory representation of a "reference file" attachment of one model to another. Any model
* may have multiple ReferenceFiles attached to it, and conversely any model may be referenced through many ReferenceFiles.
* Note that when a model is referenced multiple times and also has ReferenceFiles of its own (aka "nested reference"), there 
* will be a unique ReferenceFile object for each path to the child reference through each parent.
* @bsiclass                                                     Bentley Systems
+===============+===============+===============+===============+===============+======*/
struct          referenceFile : _referenceFile
{
private:
    virtual void MakeClassAbstract() = 0;

public:
    //! Get the DgnModelRef for this ReferenceFile, or NULL
    MSCORE_EXPORT DgnModelRefP              GetModelRef() const {return file_id.modelRef;}

    //! Get the DgnCache of the model this ReferenceFile displays, or NULL.
    DgnCacheP                               GetDgnCache() const {return mdlModelRef_getCache(file_id.modelRef);}

    //! Get the DgnFile holding the model this ReferenceFile displays, or NULL.
    MSDgnFileP                              GetDgnFile() const {return (MSDgnFileP) dgnCache_getDgnFile(GetDgnCache());}
    //! If this is a nested ReferenceFile, return its parent ReferenceFile. Otherwise, returns NULL.
    MSCORE_EXPORT ReferenceFileP            GetParent() const;

    //! If this is a nested ReferenceFile, get the parent's DgnModelRef. Otherwise, returns NULL.
    MSCORE_EXPORT DgnModelRefP              GetParentModelRef() const;

    //! Check whether this ReferenceFile can be activated. There are various reasons why some ReferenceFiles cannot be activated. 
    //! For example, ReferenceFiles that have been geographically reprojected cannot be edited. Also self-references cannot be displayed.
    //! Also, applications can mark their ReferenceFiles as non-editable themselves.
    MSCORE_EXPORT bool                      AllowActivation() const;

    //! Activate (make editable) this ReferenceFile. If the DgnFile holding this ReferenceFile is not currently opened for write access, 
    //! this method will attempt to reopen the file for write access. If that succeeds, all of the DgnCaches of that file are emptied and
    //! then reloaded. The DgnModelRef of this ReferenceFile becomes the ActiveModel.
    //! @return SUCCESS if this ReferenceFile was successfully prompted to become the ActiveModel, and ERROR if the attempt failed.
    //! @note It is important to recognize that because the file may have been edited by another user before the ReferenceFile is activated, 
    //! the contents of the DgnCache are potentially significantly different than what the user was observing when (s)he requested the
    //! activation.
    //! @note After this call, the current command is terminated and the default command is started. This happens whether the activation
    //! process succeeds or not.
    //! @see ISessionMgr::MakeActiveModel
    MSCORE_EXPORT StatusInt                 Activate();

    //! Release the write lock for the DgnFile associated with this ReferenceFile.
    //! @param[in] releaseChildLocksToo If true, find all nested ReferenceFiles of this ReferenceFile and attempt to release their
    //! write locks too. 
    //! @see ISessionMgr::ReleaseWriteLock
    MSCORE_EXPORT StatusInt                 ReleaseWriteLock (bool releaseChildLocksToo=false);
};
#endif

#endif // __cplusplus

I can't find new versions of these functions e.g. in DgnAttachment.h

Any ideas?

Regards, Tom


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>